summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-11 11:21:54 +0000
committerattila <attila@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-10-11 11:21:54 +0000
commit12882989fc19ed8e5fc08990872a8f25130d6f5a (patch)
tree3f0114158e51541f18f9d664088e05b8b6b81bf5 /libmpcodecs
parent56490d4faa67e816db3efcbb71abd9b66021c092 (diff)
downloadmpv-12882989fc19ed8e5fc08990872a8f25130d6f5a.tar.bz2
mpv-12882989fc19ed8e5fc08990872a8f25130d6f5a.tar.xz
skip null frames in mpeg files, patch by Zoltan Hidvegi <mplayer@hzoli.2y.net>
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
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vd_libmpeg2.c2
1 files changed, 2 insertions, 0 deletions
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;