You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
fftools/ffmpeg: move freeing the output file to ffmpeg_mux.c
This commit is contained in:
@@ -565,19 +565,9 @@ static void ffmpeg_cleanup(int ret)
|
|||||||
av_freep(&subtitle_out);
|
av_freep(&subtitle_out);
|
||||||
|
|
||||||
/* close files */
|
/* close files */
|
||||||
for (i = 0; i < nb_output_files; i++) {
|
for (i = 0; i < nb_output_files; i++)
|
||||||
OutputFile *of = output_files[i];
|
of_close(&output_files[i]);
|
||||||
AVFormatContext *s;
|
|
||||||
if (!of)
|
|
||||||
continue;
|
|
||||||
s = of->ctx;
|
|
||||||
if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE))
|
|
||||||
avio_closep(&s->pb);
|
|
||||||
avformat_free_context(s);
|
|
||||||
av_dict_free(&of->opts);
|
|
||||||
|
|
||||||
av_freep(&output_files[i]);
|
|
||||||
}
|
|
||||||
for (i = 0; i < nb_output_streams; i++) {
|
for (i = 0; i < nb_output_streams; i++) {
|
||||||
OutputStream *ost = output_streams[i];
|
OutputStream *ost = output_streams[i];
|
||||||
|
|
||||||
|
@@ -690,6 +690,7 @@ int hwaccel_decode_init(AVCodecContext *avctx);
|
|||||||
/* open the muxer when all the streams are initialized */
|
/* open the muxer when all the streams are initialized */
|
||||||
int of_check_init(OutputFile *of);
|
int of_check_init(OutputFile *of);
|
||||||
int of_write_trailer(OutputFile *of);
|
int of_write_trailer(OutputFile *of);
|
||||||
|
void of_close(OutputFile **pof);
|
||||||
|
|
||||||
void of_write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost,
|
void of_write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost,
|
||||||
int unqueue);
|
int unqueue);
|
||||||
|
@@ -311,3 +311,20 @@ int of_write_trailer(OutputFile *of)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void of_close(OutputFile **pof)
|
||||||
|
{
|
||||||
|
OutputFile *of = *pof;
|
||||||
|
AVFormatContext *s;
|
||||||
|
|
||||||
|
if (!of)
|
||||||
|
return;
|
||||||
|
|
||||||
|
s = of->ctx;
|
||||||
|
if (s && s->oformat && !(s->oformat->flags & AVFMT_NOFILE))
|
||||||
|
avio_closep(&s->pb);
|
||||||
|
avformat_free_context(s);
|
||||||
|
av_dict_free(&of->opts);
|
||||||
|
|
||||||
|
av_freep(pof);
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user