1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

fftools/ffmpeg_demux: drop ist_output_add()

It is now a trivial wrapper over ist_use(), so export that directly.
This commit is contained in:
Anton Khirnov 2024-09-24 09:35:56 +02:00
parent 8e805b9c3c
commit f295b4d8a0
3 changed files with 13 additions and 24 deletions

View File

@ -870,7 +870,8 @@ int64_t of_filesize(OutputFile *of);
int ifile_open(const OptionsContext *o, const char *filename, Scheduler *sch);
void ifile_close(InputFile **f);
int ist_output_add(InputStream *ist, OutputStream *ost);
int ist_use(InputStream *ist, int decoding_needed,
const ViewSpecifier *vs, SchedulerNode *src);
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
const ViewSpecifier *vs, InputFilterOptions *opts,
SchedulerNode *src);

View File

@ -873,7 +873,7 @@ void ifile_close(InputFile **pf)
av_freep(pf);
}
static int ist_use(InputStream *ist, int decoding_needed,
int ist_use(InputStream *ist, int decoding_needed,
const ViewSpecifier *vs, SchedulerNode *src)
{
Demuxer *d = demuxer_from_ifile(ist->file);
@ -974,19 +974,6 @@ static int ist_use(InputStream *ist, int decoding_needed,
return 0;
}
int ist_output_add(InputStream *ist, OutputStream *ost)
{
DemuxStream *ds = ds_from_ist(ist);
SchedulerNode src;
int ret;
ret = ist_use(ist, ost->enc ? DECODING_FOR_OST : 0, NULL, &src);
if (ret < 0)
return ret;
return ost->enc ? ds->sch_idx_dec : ds->sch_idx_stream;
}
int ist_filter_add(InputStream *ist, InputFilter *ifilter, int is_simple,
const ViewSpecifier *vs, InputFilterOptions *opts,
SchedulerNode *src)

View File

@ -1537,18 +1537,19 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
if (ret < 0)
goto fail;
} else if (ost->ist) {
int sched_idx = ist_output_add(ost->ist, ost);
if (sched_idx < 0) {
SchedulerNode src;
ret = ist_use(ost->ist, !!ost->enc, NULL, &src);
if (ret < 0) {
av_log(ost, AV_LOG_ERROR,
"Error binding an input stream\n");
ret = sched_idx;
goto fail;
}
ms->sch_idx_src = sched_idx;
ms->sch_idx_src = src.idx;
if (ost->enc) {
ret = sch_connect(mux->sch, SCH_DEC_OUT(sched_idx, 0),
SCH_ENC(ms->sch_idx_enc));
ret = sch_connect(mux->sch,
src, SCH_ENC(ms->sch_idx_enc));
if (ret < 0)
goto fail;
@ -1557,8 +1558,8 @@ static int ost_add(Muxer *mux, const OptionsContext *o, enum AVMediaType type,
if (ret < 0)
goto fail;
} else {
ret = sch_connect(mux->sch, SCH_DSTREAM(ost->ist->file->index, sched_idx),
SCH_MSTREAM(ost->file->index, ms->sch_idx));
ret = sch_connect(mux->sch,
src, SCH_MSTREAM(ost->file->index, ms->sch_idx));
if (ret < 0)
goto fail;
}