[vlc-devel] [PATCH 18/18] decoder: no need for special cleaning of the decoder format to create the display

Steve Lhomme robux4 at ycbcr.xyz
Mon Oct 28 13:41:35 CET 2019


It's already done before in the decoder helper.
---
 src/input/decoder.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index edcf8447ef4..496d9c7e9a1 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -402,11 +402,6 @@ static int ModuleThread_UpdateAudioFormat( decoder_t *p_dec )
     return 0;
 }
 
-static void FixDisplayFormat(decoder_t *p_dec, video_format_t *fmt)
-{
-    *fmt = p_dec->fmt_out.video;
-}
-
 static int CreateVoutIfNeeded(struct decoder_owner *, vout_thread_t **, enum vlc_vout_order *, vlc_decoder_device **);
 
 
@@ -431,9 +426,6 @@ static int ModuleThread_UpdateVideoFormat( decoder_t *p_dec, vlc_video_context *
 
     // configure the new vout
 
-    video_format_t fmt;
-    FixDisplayFormat( p_dec, &fmt );
-
     if ( p_owner->out_pool == NULL )
     {
         unsigned dpb_size;
@@ -458,7 +450,7 @@ static int ModuleThread_UpdateVideoFormat( decoder_t *p_dec, vlc_video_context *
             break;
         }
 
-        p_owner->out_pool = picture_pool_NewFromFormat( &fmt,
+        p_owner->out_pool = picture_pool_NewFromFormat( &p_dec->fmt_out.video,
                             dpb_size + p_dec->i_extra_picture_buffers + 1 );
         if (p_owner->out_pool == NULL)
             return -1;
@@ -466,14 +458,14 @@ static int ModuleThread_UpdateVideoFormat( decoder_t *p_dec, vlc_video_context *
     int res;
     if (p_owner->vout_thread_started)
     {
-        res = vout_ChangeSource(p_vout, &fmt);
+        res = vout_ChangeSource(p_vout, &p_dec->fmt_out.video);
         if (res == 0)
             // the display/thread is started and can handle the new source format
             return 0;
     }
 
     vout_configuration_t cfg = {
-        .vout = p_vout, .clock = p_owner->p_clock, .fmt = &fmt,
+        .vout = p_vout, .clock = p_owner->p_clock, .fmt = &p_dec->fmt_out.video,
         .mouse_event = MouseEvent, .mouse_opaque = p_dec,
     };
     res = input_resource_StartVout( p_owner->p_resource, vctx, &cfg);
@@ -554,9 +546,6 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
         return -1;
     }
 
-    video_format_t fmt;
-    FixDisplayFormat(p_dec, &fmt);
-
     vlc_mutex_lock( &p_owner->lock );
 
     vout_thread_t *p_vout = p_owner->p_vout;
@@ -565,7 +554,7 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner,
 
     if ( pp_dec_dev ) *pp_dec_dev = NULL;
     vout_device_configuration_t cfg = {
-        .vout = p_vout, .fmt = &fmt,
+        .vout = p_vout, .fmt = &p_dec->fmt_out.video,
     };
     p_vout = input_resource_GetVoutDecoderDevice( p_owner->p_resource,
                                     &cfg, order, pp_dec_dev );
-- 
2.17.1



More information about the vlc-devel mailing list