[vlc-commits] vout: make vout_FilterDisplay() work always
Rémi Denis-Courmont
git at videolan.org
Wed Jul 26 21:08:16 CEST 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 26 21:54:56 2017 +0300| [5908911afb80b6c274525018c1fbf55ebebac594] | committer: Rémi Denis-Courmont
vout: make vout_FilterDisplay() work always
Deal with the trivial case whereby the vout is unfiltered. Simplify the
call sites accordingly.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5908911afb80b6c274525018c1fbf55ebebac594
---
src/video_output/display.c | 8 +++++---
src/video_output/video_output.c | 16 ++++++++--------
2 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 055bb7d01d..fe2c86e75c 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1092,11 +1092,14 @@ picture_t *vout_FilterDisplay(vout_display_t *vd, picture_t *picture)
{
vout_display_owner_sys_t *osys = vd->owner.sys;
- assert(osys->filters);
+ if (osys->filters == NULL)
+ return picture;
+
if (filter_chain_IsEmpty(osys->filters)) {
picture_Release(picture);
return NULL;
}
+
return filter_chain_VideoFilter(osys->filters, picture);
}
@@ -1451,8 +1454,7 @@ static void SplitterPrepare(vout_display_t *vd,
}
for (int i = 0; i < sys->count; i++) {
- if (vout_IsDisplayFiltered(sys->display[i]))
- sys->picture[i] = vout_FilterDisplay(sys->display[i], sys->picture[i]);
+ sys->picture[i] = vout_FilterDisplay(sys->display[i], sys->picture[i]);
if (sys->picture[i])
vout_display_Prepare(sys->display[i], sys->picture[i], NULL);
}
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 336b97e7ba..640232a0ea 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1045,17 +1045,17 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
/* Render the direct buffer */
vout_UpdateDisplaySourceProperties(vd, &todisplay->format);
+
+ todisplay = vout_FilterDisplay(vd, todisplay);
+ if (todisplay == NULL) {
+ if (subpic != NULL)
+ subpicture_Delete(subpic);
+ return VLC_EGENERIC;
+ }
+
if (sys->display.use_dr) {
vout_display_Prepare(vd, todisplay, subpic);
} else {
- todisplay = vout_FilterDisplay(vd, todisplay);
- if (todisplay == NULL)
- {
- if (subpic != NULL)
- subpicture_Delete(subpic);
- return VLC_EGENERIC;
- }
-
if (!do_dr_spu && !do_early_spu && vout->p->spu_blend && subpic)
picture_BlendSubpicture(todisplay, vout->p->spu_blend, subpic);
vout_display_Prepare(vd, todisplay, do_dr_spu ? subpic : NULL);
More information about the vlc-commits
mailing list