[vlc-commits] video_output: move the src_fmt/src_vctx init up when filters change
Steve Lhomme
git at videolan.org
Mon Dec 9 09:01:29 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Nov 12 13:23:50 2019 +0100| [7f1647a5005257084b8f02f586ffe403c2546e85] | committer: Steve Lhomme
video_output: move the src_fmt/src_vctx init up when filters change
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f1647a5005257084b8f02f586ffe403c2546e85
---
src/video_output/video_output.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index ee7e54072a..2f024ceead 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -812,6 +812,14 @@ static void ThreadChangeFilters(vout_thread_t *vout,
if (!is_locked)
vlc_mutex_lock(&vout->p->filter.lock);
+ if (source) {
+ video_format_Clean(&vout->p->filter.src_fmt);
+ video_format_Copy(&vout->p->filter.src_fmt, source);
+ if (vout->p->filter.src_vctx)
+ vlc_video_context_Release(vout->p->filter.src_vctx);
+ vout->p->filter.src_vctx = src_vctx ? vlc_video_context_Hold(src_vctx) : NULL;
+ }
+
es_format_t fmt_target;
es_format_InitFromVideo(&fmt_target, source ? source : &vout->p->filter.src_fmt);
vlc_video_context *vctx_target = source ? src_vctx : vout->p->filter.src_vctx;
@@ -867,13 +875,6 @@ static void ThreadChangeFilters(vout_thread_t *vout,
free(vout->p->filter.configuration);
vout->p->filter.configuration = filters ? strdup(filters) : NULL;
}
- if (source) {
- video_format_Clean(&vout->p->filter.src_fmt);
- video_format_Copy(&vout->p->filter.src_fmt, source);
- if (vout->p->filter.src_vctx)
- vlc_video_context_Release(vout->p->filter.src_vctx);
- vout->p->filter.src_vctx = src_vctx ? vlc_video_context_Hold(src_vctx) : NULL;
- }
if (!is_locked)
vlc_mutex_unlock(&vout->p->filter.lock);
More information about the vlc-commits
mailing list