MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / avcodec_flush_buffers

Function avcodec_flush_buffers

libavcodec/avcodec.c:381–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381void avcodec_flush_buffers(AVCodecContext *avctx)
382{
383 AVCodecInternal *avci = avctx->internal;
384
385 if (av_codec_is_encoder(avctx->codec)) {
386 int caps = avctx->codec->capabilities;
387
388 if (!(caps & AV_CODEC_CAP_ENCODER_FLUSH)) {
389 // Only encoders that explicitly declare support for it can be
390 // flushed. Otherwise, this is a no-op.
391 av_log(avctx, AV_LOG_WARNING, "Ignoring attempt to flush encoder "
392 "that doesn't support it\n");
393 return;
394 }
395 ff_encode_flush_buffers(avctx);
396 } else
397 ff_decode_flush_buffers(avctx);
398
399 avci->draining = 0;
400 avci->draining_done = 0;
401 if (avci->buffer_frame)
402 av_frame_unref(avci->buffer_frame);
403 if (avci->buffer_pkt)
404 av_packet_unref(avci->buffer_pkt);
405
406 if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME &&
407 !avci->is_frame_mt)
408 ff_thread_flush(avctx);
409 else if (ffcodec(avctx->codec)->flush)
410 ffcodec(avctx->codec)->flush(avctx);
411}
412
413void avsubtitle_free(AVSubtitle *sub)
414{

Callers 10

LLVMFuzzerTestOneInputFunction · 0.85
decoder_decode_frameFunction · 0.85
decoder_threadFunction · 0.85
read_interval_packetsFunction · 0.85
ff_thread_flushFunction · 0.85
imm5_flushFunction · 0.85
ftr_flushFunction · 0.85
rewind_fileFunction · 0.85
process_commandFunction · 0.85
compute_crc_of_packetsFunction · 0.85

Calls 8

av_codec_is_encoderFunction · 0.85
av_logFunction · 0.85
ff_encode_flush_buffersFunction · 0.85
ff_decode_flush_buffersFunction · 0.85
av_frame_unrefFunction · 0.85
av_packet_unrefFunction · 0.85
ff_thread_flushFunction · 0.85
ffcodecFunction · 0.85

Tested by 1

compute_crc_of_packetsFunction · 0.68