diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-07-17 12:29:07 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-07-17 12:29:07 +0000 |
commit | 7a06ff148d0321e863a682334c59f59b3e8e7b6d (patch) | |
tree | 4b6b4fd27b6fb39589517a0bfde54f701d319130 /libavcodec/utils.c | |
parent | bc3513865a10f0f070bdc4eafd4e0df2b2ca3f6d (diff) | |
download | ffmpeg-7a06ff148d0321e863a682334c59f59b3e8e7b6d.tar.gz |
AVCodec.flush()
ff_draw_horiz_band() in coded order / cleanup
Originally committed as revision 2064 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 36 |
1 files changed, 5 insertions, 31 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5c25463747..eeffde2c9e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -590,39 +590,13 @@ void avcodec_init(void) dsputil_static_init(); } -/* this can be called after seeking and before trying to decode the next keyframe */ +/** + * Flush buffers, should be called when seeking or when swicthing to a different stream. + */ void avcodec_flush_buffers(AVCodecContext *avctx) { - int i; - MpegEncContext *s = avctx->priv_data; - - switch(avctx->codec_id){ - case CODEC_ID_MPEG1VIDEO: - case CODEC_ID_H263: - case CODEC_ID_RV10: -// case CODEC_ID_MJPEG: -// case CODEC_ID_MJPEGB: - case CODEC_ID_MPEG4: - case CODEC_ID_MSMPEG4V1: - case CODEC_ID_MSMPEG4V2: - case CODEC_ID_MSMPEG4V3: - case CODEC_ID_WMV1: - case CODEC_ID_WMV2: - case CODEC_ID_H263P: - case CODEC_ID_H263I: - case CODEC_ID_FLV1: - case CODEC_ID_SVQ1: - for(i=0; i<MAX_PICTURE_COUNT; i++){ - if(s->picture[i].data[0] && ( s->picture[i].type == FF_BUFFER_TYPE_INTERNAL - || s->picture[i].type == FF_BUFFER_TYPE_USER)) - avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]); - } - s->last_picture_ptr = s->next_picture_ptr = NULL; - break; - default: - //FIXME - break; - } + if(avctx->codec->flush) + avctx->codec->flush(avctx); } void avcodec_default_free_buffers(AVCodecContext *s){ |