mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
fftools/ffmpeg: move closing the input file into a separate function
For now this is just closing the format context and freeing InputFile, but will contain more in the future.
This commit is contained in:
parent
09cd147dcc
commit
295848bacb
@ -556,10 +556,9 @@ static void ffmpeg_cleanup(int ret)
|
|||||||
of_close(&output_files[i]);
|
of_close(&output_files[i]);
|
||||||
|
|
||||||
free_input_threads();
|
free_input_threads();
|
||||||
for (i = 0; i < nb_input_files; i++) {
|
for (i = 0; i < nb_input_files; i++)
|
||||||
avformat_close_input(&input_files[i]->ctx);
|
ifile_close(&input_files[i]);
|
||||||
av_freep(&input_files[i]);
|
|
||||||
}
|
|
||||||
for (i = 0; i < nb_input_streams; i++) {
|
for (i = 0; i < nb_input_streams; i++) {
|
||||||
InputStream *ist = input_streams[i];
|
InputStream *ist = input_streams[i];
|
||||||
|
|
||||||
|
@ -758,6 +758,7 @@ AVChapter * const *
|
|||||||
of_get_chapters(OutputFile *of, unsigned int *nb_chapters);
|
of_get_chapters(OutputFile *of, unsigned int *nb_chapters);
|
||||||
|
|
||||||
int ifile_open(OptionsContext *o, const char *filename);
|
int ifile_open(OptionsContext *o, const char *filename);
|
||||||
|
void ifile_close(InputFile **f);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get next input packet from the demuxer.
|
* Get next input packet from the demuxer.
|
||||||
|
@ -439,6 +439,18 @@ int ifile_get_packet(InputFile *f, AVPacket **pkt)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ifile_close(InputFile **pf)
|
||||||
|
{
|
||||||
|
InputFile *f = *pf;
|
||||||
|
|
||||||
|
if (!f)
|
||||||
|
return;
|
||||||
|
|
||||||
|
avformat_close_input(&f->ctx);
|
||||||
|
|
||||||
|
av_freep(pf);
|
||||||
|
}
|
||||||
|
|
||||||
static const AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st,
|
static const AVCodec *choose_decoder(OptionsContext *o, AVFormatContext *s, AVStream *st,
|
||||||
enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type)
|
enum HWAccelID hwaccel_id, enum AVHWDeviceType hwaccel_device_type)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user