Fix crash when transcoding from mpeg2
authorAurélien Nephtali <aurelien@sitadelle.com>
Tue, 17 Feb 2009 14:47:07 +0000 (15:47 +0100)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 17 Feb 2009 19:29:17 +0000 (21:29 +0200)
The attached patch fixes transcoding from mpeg2 with last VLC from git.

jupiter@~/vlc> ./vlc file.ts --sout
'#transcode{vcodec=mp4v}:std{access=file,mux=ts,dst=/dev/null}' -I
dummy
[...]
[0x212d9c0] libmpeg2 decoder debug: 720x576 (display 720,576), aspect
768000, sar 64:45, 25.000 fps
[0x212d9c0] main decoder warning: can't get output picture
[0x212d9c0] libmpeg2 decoder warning: invalid picture encountered
[0x212d9c0] main decoder warning: can't get output picture
zsh: segmentation fault  ./vlc file.ts --sout  -I dummy

Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
modules/stream_out/transcode.c

index 473467c..67433d1 100644 (file)
@@ -2185,12 +2185,12 @@ static picture_t *video_new_buffer( vlc_object_t *p_this, picture_t **pp_ring,
         i = 0;
     }
 
+    p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
     p_pic = picture_New( p_dec->fmt_out.video.i_chroma,
                          p_dec->fmt_out.video.i_width,
                          p_dec->fmt_out.video.i_height,
                          p_dec->fmt_out.video.i_aspect );
     if( !p_pic ) return NULL;
-    p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
     p_pic->p_sys = calloc( 1, sizeof(picture_sys_t) );
     if( !p_pic->p_sys )
     {