From c9c07afcf8136e22c0365d7eca6dfaba4cb6dbc9 Mon Sep 17 00:00:00 2001 From: James Stembridge Date: Thu, 20 Mar 2003 23:29:06 +0000 Subject: If first frame is not a keyframe then don't decode it or change state of decoder CVS patchset: 4456 CVS date: 2003/03/20 23:29:06 --- src/libffmpeg/libavcodec/mpegvideo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c index 45f0c9909..f49b1c2b5 100644 --- a/src/libffmpeg/libavcodec/mpegvideo.c +++ b/src/libffmpeg/libavcodec/mpegvideo.c @@ -900,7 +900,7 @@ static int find_unused_picture(MpegEncContext *s, int shared){ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) { int i; - AVFrame *pic; + AVFrame *pic = NULL; s->mb_skiped = 0; @@ -927,7 +927,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx) } } } -alloc: + if(!s->encoding){ i= find_unused_picture(s, 0); @@ -948,7 +948,9 @@ alloc: if(s->pict_type != I_TYPE && s->last_picture.data[0]==NULL){ fprintf(stderr, "warning: first frame is no keyframe\n"); XINE_ASSERT(s->pict_type != B_TYPE, "These should have been dropped if we dont have a reference"); - goto alloc; + free_picture(s, (Picture*) pic); + s->last_picture.data[0] = s->next_picture.data[0] = NULL; + return -1; } s->hurry_up= s->avctx->hurry_up; -- cgit v1.2.3