You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/avcodec: Don't reset decoder-fields for encoders when flushing
Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -422,6 +422,17 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
if (avci->in_frame)
|
if (avci->in_frame)
|
||||||
av_frame_unref(avci->in_frame);
|
av_frame_unref(avci->in_frame);
|
||||||
|
} else {
|
||||||
|
av_packet_unref(avci->last_pkt_props);
|
||||||
|
while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0)
|
||||||
|
av_packet_unref(avci->last_pkt_props);
|
||||||
|
|
||||||
|
av_packet_unref(avci->in_pkt);
|
||||||
|
|
||||||
|
avctx->pts_correction_last_pts =
|
||||||
|
avctx->pts_correction_last_dts = INT64_MIN;
|
||||||
|
|
||||||
|
av_bsf_flush(avci->bsf);
|
||||||
}
|
}
|
||||||
|
|
||||||
avci->draining = 0;
|
avci->draining = 0;
|
||||||
@@ -430,22 +441,10 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
|
|||||||
av_frame_unref(avci->buffer_frame);
|
av_frame_unref(avci->buffer_frame);
|
||||||
av_packet_unref(avci->buffer_pkt);
|
av_packet_unref(avci->buffer_pkt);
|
||||||
|
|
||||||
av_packet_unref(avci->last_pkt_props);
|
|
||||||
while (av_fifo_read(avci->pkt_props, avci->last_pkt_props, 1) >= 0)
|
|
||||||
av_packet_unref(avci->last_pkt_props);
|
|
||||||
|
|
||||||
av_packet_unref(avci->in_pkt);
|
|
||||||
|
|
||||||
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
|
if (HAVE_THREADS && avctx->active_thread_type & FF_THREAD_FRAME)
|
||||||
ff_thread_flush(avctx);
|
ff_thread_flush(avctx);
|
||||||
else if (ffcodec(avctx->codec)->flush)
|
else if (ffcodec(avctx->codec)->flush)
|
||||||
ffcodec(avctx->codec)->flush(avctx);
|
ffcodec(avctx->codec)->flush(avctx);
|
||||||
|
|
||||||
avctx->pts_correction_last_pts =
|
|
||||||
avctx->pts_correction_last_dts = INT64_MIN;
|
|
||||||
|
|
||||||
if (avci->bsf)
|
|
||||||
av_bsf_flush(avci->bsf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void avsubtitle_free(AVSubtitle *sub)
|
void avsubtitle_free(AVSubtitle *sub)
|
||||||
|
Reference in New Issue
Block a user