[vlc-commits] packetizer:mpegvideo: set the output codec only if the init is successful

Steve Lhomme git at videolan.org
Fri Jul 21 13:25:57 CEST 2017


vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Wed Jul 19 13:00:52 2017 +0200| [3b1252ef67dedbeb523341b579a911ac5e567731] | committer: Jean-Baptiste Kempf

packetizer:mpegvideo: set the output codec only if the init is successful

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

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

 modules/packetizer/mpegvideo.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 8e5a0a65c6..d8e988c2ec 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -168,15 +168,14 @@ static int Open( vlc_object_t *p_this )
     if( p_dec->fmt_in.i_codec != VLC_CODEC_MPGV )
         return VLC_EGENERIC;
 
-    es_format_Init( &p_dec->fmt_out, VIDEO_ES, VLC_CODEC_MPGV );
-    p_dec->fmt_out.i_original_fourcc = p_dec->fmt_in.i_original_fourcc;
-
-
     p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
     if( !p_dec->p_sys )
         return VLC_ENOMEM;
     memset( p_dec->p_sys, 0, sizeof( decoder_sys_t ) );
 
+    p_dec->fmt_out.i_codec = VLC_CODEC_MPGV;
+    p_dec->fmt_out.i_original_fourcc = p_dec->fmt_in.i_original_fourcc;
+
     /* Misc init */
     packetizer_Init( &p_sys->packetizer,
                      p_mp2v_startcode, sizeof(p_mp2v_startcode), startcode_FindAnnexB,



More information about the vlc-commits mailing list