You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
fftools/ffmpeg: move freeing 2pass input stats to a better place
The current placement of this free is historical - it used to be followed by avcodec_close(), since removed. The proper place for freeing the stats is currently right before the encoder context itself is freed.
This commit is contained in:
@@ -588,6 +588,8 @@ static void ffmpeg_cleanup(int ret)
|
|||||||
av_dict_free(&ost->sws_dict);
|
av_dict_free(&ost->sws_dict);
|
||||||
av_dict_free(&ost->swr_opts);
|
av_dict_free(&ost->swr_opts);
|
||||||
|
|
||||||
|
if (ost->enc_ctx)
|
||||||
|
av_freep(&ost->enc_ctx->stats_in);
|
||||||
avcodec_free_context(&ost->enc_ctx);
|
avcodec_free_context(&ost->enc_ctx);
|
||||||
avcodec_parameters_free(&ost->ref_par);
|
avcodec_parameters_free(&ost->ref_par);
|
||||||
|
|
||||||
@@ -4359,9 +4361,6 @@ static int transcode(void)
|
|||||||
/* close each encoder */
|
/* close each encoder */
|
||||||
for (i = 0; i < nb_output_streams; i++) {
|
for (i = 0; i < nb_output_streams; i++) {
|
||||||
ost = output_streams[i];
|
ost = output_streams[i];
|
||||||
if (ost->encoding_needed) {
|
|
||||||
av_freep(&ost->enc_ctx->stats_in);
|
|
||||||
}
|
|
||||||
total_packets_written += ost->packets_written;
|
total_packets_written += ost->packets_written;
|
||||||
if (!ost->packets_written && (abort_on_flags & ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM)) {
|
if (!ost->packets_written && (abort_on_flags & ABORT_ON_FLAG_EMPTY_OUTPUT_STREAM)) {
|
||||||
av_log(NULL, AV_LOG_FATAL, "Empty output on stream %d.\n", i);
|
av_log(NULL, AV_LOG_FATAL, "Empty output on stream %d.\n", i);
|
||||||
|
Reference in New Issue
Block a user