mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
fftools/ffmpeg: drop init_input_threads()
Start threads implicitly when ifile_get_packet() is called. Simplifies the demuxer API.
This commit is contained in:
parent
6975320506
commit
09cd147dcc
@ -3912,9 +3912,6 @@ static int transcode(void)
|
||||
|
||||
timer_start = av_gettime_relative();
|
||||
|
||||
if ((ret = init_input_threads()) < 0)
|
||||
goto fail;
|
||||
|
||||
while (!received_sigterm) {
|
||||
int64_t cur_time= av_gettime_relative();
|
||||
|
||||
|
@ -770,7 +770,6 @@ int ifile_open(OptionsContext *o, const char *filename);
|
||||
* - a negative error code on failure
|
||||
*/
|
||||
int ifile_get_packet(InputFile *f, AVPacket **pkt);
|
||||
int init_input_threads(void);
|
||||
void free_input_threads(void);
|
||||
|
||||
#define SPECIFIER_OPT_FMT_str "%s"
|
||||
|
@ -346,11 +346,10 @@ void free_input_threads(void)
|
||||
free_input_thread(i);
|
||||
}
|
||||
|
||||
static int init_input_thread(int i)
|
||||
static int thread_start(Demuxer *d)
|
||||
{
|
||||
int ret;
|
||||
InputFile *f = input_files[i];
|
||||
Demuxer *d = demuxer_from_ifile(f);
|
||||
InputFile *f = &d->f;
|
||||
|
||||
if (f->thread_queue_size <= 0)
|
||||
f->thread_queue_size = (nb_input_files > 1 ? 8 : 1);
|
||||
@ -393,24 +392,19 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int init_input_threads(void)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < nb_input_files; i++) {
|
||||
ret = init_input_thread(i);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ifile_get_packet(InputFile *f, AVPacket **pkt)
|
||||
{
|
||||
Demuxer *d = demuxer_from_ifile(f);
|
||||
InputStream *ist;
|
||||
DemuxMsg msg;
|
||||
int ret;
|
||||
|
||||
if (!f->in_thread_queue) {
|
||||
ret = thread_start(d);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (f->readrate || f->rate_emu) {
|
||||
int i;
|
||||
int64_t file_start = copy_ts * (
|
||||
|
Loading…
Reference in New Issue
Block a user