diff options
author | James Stembridge <jstembridge@users.sourceforge.net> | 2003-03-20 23:29:06 +0000 |
---|---|---|
committer | James Stembridge <jstembridge@users.sourceforge.net> | 2003-03-20 23:29:06 +0000 |
commit | c9c07afcf8136e22c0365d7eca6dfaba4cb6dbc9 (patch) | |
tree | 31062aa96eb895d350426d9ac94f5c1a9c890b08 | |
parent | 8c1ea3f70c081a29c135304b18b6df1a3b3b675b (diff) | |
download | xine-lib-c9c07afcf8136e22c0365d7eca6dfaba4cb6dbc9.tar.gz xine-lib-c9c07afcf8136e22c0365d7eca6dfaba4cb6dbc9.tar.bz2 |
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
-rw-r--r-- | src/libffmpeg/libavcodec/mpegvideo.c | 8 |
1 files 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; |