From 12882989fc19ed8e5fc08990872a8f25130d6f5a Mon Sep 17 00:00:00 2001 From: attila Date: Sat, 11 Oct 2003 11:21:54 +0000 Subject: [PATCH] skip null frames in mpeg files, patch by Zoltan Hidvegi I have an mpeg2 avi (created with mencoder -oac copy -ovc copy from a dvd) that has null frames, probably inserted by mencoder. I can play that with -vfm ffmpeg, but mplayer dump when played with the default libmpeg2, the trivial patch below fixes that. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11081 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_libmpeg2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c index 41f8fc37a9..71ec28f3ca 100644 --- a/libmpcodecs/vd_libmpeg2.c +++ b/libmpcodecs/vd_libmpeg2.c @@ -97,6 +97,8 @@ static mp_image_t* decode(sh_video_t *sh,void* data,int len,int flags){ mp_image_t* mpi=NULL; int drop_frame, framedrop=flags&3; + if(len<=0) return NULL; // skipped null frame + // append extra 'end of frame' code: ((char*)data+len)[0]=0; ((char*)data+len)[1]=0;