[vlc-commits] rawvideo: only copy the input es_format_t on output for the decoder

Steve Lhomme git at videolan.org
Wed Jul 12 12:23:44 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Tue Jul 11 11:19:49 2017 +0200| [ac2886e617b9ba25d3c6f2d52a1bdaf020f119a7] | committer: Jean-Baptiste Kempf

rawvideo: only copy the input es_format_t on output for the decoder

It's automatically done for packetizers.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ac2886e617b9ba25d3c6f2d52a1bdaf020f119a7
---

 modules/codec/rawvideo.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c
index 97833022d7..3db4c94d0b 100644
--- a/modules/codec/rawvideo.c
+++ b/modules/codec/rawvideo.c
@@ -76,7 +76,7 @@ vlc_module_end ()
 /**
  * Common initialization for decoder and packetizer
  */
-static int OpenCommon( decoder_t *p_dec )
+static int OpenCommon( decoder_t *p_dec, bool b_packetizer )
 {
     const vlc_chroma_description_t *dsc =
         vlc_fourcc_GetChromaDescription( p_dec->fmt_in.i_codec );
@@ -100,7 +100,8 @@ static int OpenCommon( decoder_t *p_dec )
     if( !p_dec->fmt_in.video.i_visible_height )
         p_dec->fmt_in.video.i_visible_height = p_dec->fmt_in.video.i_height;
 
-    es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
+    if ( !b_packetizer )
+        es_format_Copy( &p_dec->fmt_out, &p_dec->fmt_in );
 
     date_Init( &p_sys->pts, p_dec->fmt_out.video.i_frame_rate,
                p_dec->fmt_out.video.i_frame_rate_base );
@@ -267,7 +268,7 @@ static int OpenDecoder( vlc_object_t *p_this )
 {
     decoder_t *p_dec = (decoder_t *)p_this;
 
-    int ret = OpenCommon( p_dec );
+    int ret = OpenCommon( p_dec, false );
     if( ret == VLC_SUCCESS )
     {
         p_dec->pf_decode = DecodeFrame;
@@ -305,7 +306,7 @@ static int OpenPacketizer( vlc_object_t *p_this )
 {
     decoder_t *p_dec = (decoder_t *)p_this;
 
-    int ret = OpenCommon( p_dec );
+    int ret = OpenCommon( p_dec, true );
     if( ret == VLC_SUCCESS )
         p_dec->pf_packetize = SendFrame;
     return ret;



More information about the vlc-commits mailing list