diff options
Diffstat (limited to 'src/libffmpeg')
-rw-r--r-- | src/libffmpeg/libavcodec/h263dec.c | 8 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/mpegvideo.c | 3 | ||||
-rw-r--r-- | src/libffmpeg/libavcodec/mpegvideo.h | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/libffmpeg/libavcodec/h263dec.c b/src/libffmpeg/libavcodec/h263dec.c index 758f9ed52..ec14c09e2 100644 --- a/src/libffmpeg/libavcodec/h263dec.c +++ b/src/libffmpeg/libavcodec/h263dec.c @@ -114,6 +114,14 @@ static int h263_decode_frame(AVCodecContext *avctx, if (ret < 0) return -1; + /* make sure we start with an I-frame */ + if (s->waiting_for_keyframe) { + if (s->pict_type != I_TYPE) + return -1; + else + s->waiting_for_keyframe = 0; + } + MPV_frame_start(s); #ifdef DEBUG diff --git a/src/libffmpeg/libavcodec/mpegvideo.c b/src/libffmpeg/libavcodec/mpegvideo.c index 5c66b3189..9f7236f98 100644 --- a/src/libffmpeg/libavcodec/mpegvideo.c +++ b/src/libffmpeg/libavcodec/mpegvideo.c @@ -101,6 +101,8 @@ int MPV_common_init(MpegEncContext *s) int c_size, i; UINT8 *pict; + s->waiting_for_keyframe = 1; + if (s->out_format == FMT_H263) s->dct_unquantize = dct_unquantize_h263_c; else @@ -212,6 +214,7 @@ int MPV_common_init(MpegEncContext *s) if (s->aux_picture_base[i]) free(s->aux_picture_base[i]); } + return -1; } diff --git a/src/libffmpeg/libavcodec/mpegvideo.h b/src/libffmpeg/libavcodec/mpegvideo.h index 31243471e..9abe75a7c 100644 --- a/src/libffmpeg/libavcodec/mpegvideo.h +++ b/src/libffmpeg/libavcodec/mpegvideo.h @@ -181,6 +181,8 @@ typedef struct MpegEncContext { DCTELEM block[6][64] __align8; void (*dct_unquantize)(struct MpegEncContext *s, DCTELEM *block, int n, int qscale); + + int waiting_for_keyframe; } MpegEncContext; int MPV_common_init(MpegEncContext *s); |