mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 01:02:33 +00:00
fftools/ffmpeg: move discarding unused programs to ffmpeg_demux
This is a more appropriate place for this code.
This commit is contained in:
parent
f9657b7443
commit
9429624a76
@ -1498,22 +1498,6 @@ static int transcode_init(void)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/* discard unused programs */
|
|
||||||
for (int i = 0; i < nb_input_files; i++) {
|
|
||||||
InputFile *ifile = input_files[i];
|
|
||||||
for (int j = 0; j < ifile->ctx->nb_programs; j++) {
|
|
||||||
AVProgram *p = ifile->ctx->programs[j];
|
|
||||||
int discard = AVDISCARD_ALL;
|
|
||||||
|
|
||||||
for (int k = 0; k < p->nb_stream_indexes; k++)
|
|
||||||
if (!ifile->streams[p->stream_index[k]]->discard) {
|
|
||||||
discard = AVDISCARD_DEFAULT;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
p->discard = discard;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* dump the stream mapping */
|
/* dump the stream mapping */
|
||||||
av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");
|
av_log(NULL, AV_LOG_INFO, "Stream mapping:\n");
|
||||||
for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) {
|
for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) {
|
||||||
|
@ -525,6 +525,21 @@ static void readrate_sleep(Demuxer *d)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void discard_unused_programs(InputFile *ifile)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < ifile->ctx->nb_programs; j++) {
|
||||||
|
AVProgram *p = ifile->ctx->programs[j];
|
||||||
|
int discard = AVDISCARD_ALL;
|
||||||
|
|
||||||
|
for (int k = 0; k < p->nb_stream_indexes; k++)
|
||||||
|
if (!ifile->streams[p->stream_index[k]]->discard) {
|
||||||
|
discard = AVDISCARD_DEFAULT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
p->discard = discard;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void thread_set_name(InputFile *f)
|
static void thread_set_name(InputFile *f)
|
||||||
{
|
{
|
||||||
char name[16];
|
char name[16];
|
||||||
@ -548,6 +563,8 @@ static void *input_thread(void *arg)
|
|||||||
|
|
||||||
thread_set_name(f);
|
thread_set_name(f);
|
||||||
|
|
||||||
|
discard_unused_programs(f);
|
||||||
|
|
||||||
d->wallclock_start = av_gettime_relative();
|
d->wallclock_start = av_gettime_relative();
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user