[vlc-devel] [PATCH 17/21] video_output: remove reuse parameter from ThreadDisplayPreparePicture
Steve Lhomme
robux4 at ycbcr.xyz
Tue Sep 15 14:36:22 CEST 2020
It's only called with true when there is no displayed.current. That happens
- when no frame has been displayed
- after a flush
In both cases it doesn't make sense to reuse a prerendered version of a
previous picture.
---
src/video_output/video_output.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 722dd2928d8..8310d3417c5 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1067,7 +1067,7 @@ static void ThreadChangeFilters(vout_thread_sys_t *vout)
/* */
-static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reuse,
+static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout,
bool frame_by_frame, bool *paused)
{
vout_thread_sys_t *sys = vout;
@@ -1076,13 +1076,9 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
vlc_mutex_lock(&sys->filter.lock);
picture_t *picture = filter_chain_VideoFilter(sys->filter.chain_static, NULL);
- assert(!reuse || !picture);
while (!picture) {
picture_t *decoded;
- if (reuse && sys->displayed.decoded) {
- decoded = picture_Hold(sys->displayed.decoded);
- } else {
decoded = picture_fifo_Pop(sys->decoder_fifo);
if (decoded) {
@@ -1133,11 +1129,9 @@ static picture_t *ThreadDisplayPreparePicture(vout_thread_sys_t *vout, bool reus
ThreadChangeFilters(vout);
}
}
- }
if (!decoded)
break;
- reuse = false;
if (sys->displayed.decoded)
picture_Release(sys->displayed.decoded);
@@ -1483,7 +1477,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
if (!sys->displayed.current)
{
sys->displayed.current =
- ThreadDisplayPreparePicture(vout, true, frame_by_frame, &paused);
+ ThreadDisplayPreparePicture(vout, frame_by_frame, &paused);
if (sys->displayed.current == NULL)
return VLC_EGENERIC;
}
@@ -1492,7 +1486,7 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
while (!sys->displayed.next)
{
picture_t *picture =
- ThreadDisplayPreparePicture(vout, false, frame_by_frame, &paused);
+ ThreadDisplayPreparePicture(vout, frame_by_frame, &paused);
if (!picture)
break;
--
2.26.2
More information about the vlc-devel
mailing list