comparison utils.c @ 1368:0fd38b711f06 libavcodec

AVCodec.flush() ff_draw_horiz_band() in coded order / cleanup
author michaelni
date Thu, 17 Jul 2003 12:29:07 +0000
parents cfc80b3a4ada
children da0b3a50d209
comparison
equal deleted inserted replaced
1367:b33c63b53cef 1368:0fd38b711f06
588 inited = 1; 588 inited = 1;
589 589
590 dsputil_static_init(); 590 dsputil_static_init();
591 } 591 }
592 592
593 /* this can be called after seeking and before trying to decode the next keyframe */ 593 /**
594 * Flush buffers, should be called when seeking or when swicthing to a different stream.
595 */
594 void avcodec_flush_buffers(AVCodecContext *avctx) 596 void avcodec_flush_buffers(AVCodecContext *avctx)
595 { 597 {
596 int i; 598 if(avctx->codec->flush)
597 MpegEncContext *s = avctx->priv_data; 599 avctx->codec->flush(avctx);
598
599 switch(avctx->codec_id){
600 case CODEC_ID_MPEG1VIDEO:
601 case CODEC_ID_H263:
602 case CODEC_ID_RV10:
603 // case CODEC_ID_MJPEG:
604 // case CODEC_ID_MJPEGB:
605 case CODEC_ID_MPEG4:
606 case CODEC_ID_MSMPEG4V1:
607 case CODEC_ID_MSMPEG4V2:
608 case CODEC_ID_MSMPEG4V3:
609 case CODEC_ID_WMV1:
610 case CODEC_ID_WMV2:
611 case CODEC_ID_H263P:
612 case CODEC_ID_H263I:
613 case CODEC_ID_FLV1:
614 case CODEC_ID_SVQ1:
615 for(i=0; i<MAX_PICTURE_COUNT; i++){
616 if(s->picture[i].data[0] && ( s->picture[i].type == FF_BUFFER_TYPE_INTERNAL
617 || s->picture[i].type == FF_BUFFER_TYPE_USER))
618 avctx->release_buffer(avctx, (AVFrame*)&s->picture[i]);
619 }
620 s->last_picture_ptr = s->next_picture_ptr = NULL;
621 break;
622 default:
623 //FIXME
624 break;
625 }
626 } 600 }
627 601
628 void avcodec_default_free_buffers(AVCodecContext *s){ 602 void avcodec_default_free_buffers(AVCodecContext *s){
629 int i, j; 603 int i, j;
630 604