diff options
author | Loren Merritt <lorenm@u.washington.edu> | 2005-05-03 06:53:59 +0000 |
---|---|---|
committer | Loren Merritt <lorenm@u.washington.edu> | 2005-05-03 06:53:59 +0000 |
commit | 7c33ad19fd55fea2d39d040c7ebdcde0e1e9d864 (patch) | |
tree | 9d0499c43da6e2b8e0531d07c1318699eab925e8 /libavcodec | |
parent | 8b975b7ca5b2a18c8825e7e110854a11244cdf78 (diff) | |
download | ffmpeg-7c33ad19fd55fea2d39d040c7ebdcde0e1e9d864.tar.gz |
clear the DPB after seeking.
Originally committed as revision 4174 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7fdae20b7c..e315818f19 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3457,6 +3457,16 @@ static void idr(H264Context *h){ h->short_ref_count=0; } +/* forget old pics after a seek */ +static void flush_dpb(AVCodecContext *avctx){ + H264Context *h= avctx->priv_data; + int i; + for(i=0; i<16; i++) + h->delayed_pic[i]= NULL; + h->delayed_output_pic= NULL; + idr(h); +} + /** * * @return the removed picture or NULL if an error occures @@ -7208,6 +7218,7 @@ AVCodec h264_decoder = { decode_end, decode_frame, /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY, + .flush= flush_dpb, }; AVCodecParser h264_parser = { |