summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vd_libmpeg2.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpcodecs/vd_libmpeg2.c')
-rw-r--r--libmpcodecs/vd_libmpeg2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libmpcodecs/vd_libmpeg2.c b/libmpcodecs/vd_libmpeg2.c
index 26ee36c387..78759cee92 100644
--- a/libmpcodecs/vd_libmpeg2.c
+++ b/libmpcodecs/vd_libmpeg2.c
@@ -103,6 +103,11 @@ 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;
+ //MPlayer registers its own draw_slice callback, prevent libmpeg2 from freeing the context
+ mpeg2dec->decoder.convert=NULL;
+ mpeg2dec->decoder.convert_id=NULL;
+
+
if(len<=0) return NULL; // skipped null frame
// append extra 'end of frame' code: