diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-12-13 18:39:02 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-12-14 20:16:53 +0100 |
commit | 0fcea80b2a328f6fd8fc7403e46b18a6e37d6c86 (patch) | |
tree | f944d1aca6bffbd84d3f46b13ac9963d4c96c45f /fftools/ffmpeg_filter.c | |
parent | 84201d8af6255ddfbeffa38afd51f0ecf742390b (diff) | |
download | ffmpeg-0fcea80b2a328f6fd8fc7403e46b18a6e37d6c86.tar.gz |
fftools/ffmpeg: replace InputStream.file_index by a pointer
Reduces the need to use the input_files global array.
Diffstat (limited to 'fftools/ffmpeg_filter.c')
-rw-r--r-- | fftools/ffmpeg_filter.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 002bdb143d..40f52d043f 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -1457,7 +1457,7 @@ static int configure_input_video_filter(FilterGraph *fg, AVFilterGraph *graph, const AVFilter *buffer_filt = avfilter_get_by_name("buffer"); const AVPixFmtDescriptor *desc; InputStream *ist = ifp->ist; - InputFile *f = input_files[ist->file_index]; + InputFile *f = ist->file; AVRational fr = ist->framerate; AVRational sar; AVBPrint args; @@ -1498,7 +1498,7 @@ static int configure_input_video_filter(FilterGraph *fg, AVFilterGraph *graph, if (fr.num && fr.den) av_bprintf(&args, ":frame_rate=%d/%d", fr.num, fr.den); snprintf(name, sizeof(name), "graph %d input from stream %d:%d", fg->index, - ist->file_index, ist->index); + f->index, ist->index); if ((ret = avfilter_graph_create_filter(&ifp->filter, buffer_filt, name, @@ -1557,7 +1557,7 @@ static int configure_input_video_filter(FilterGraph *fg, AVFilterGraph *graph, } snprintf(name, sizeof(name), "trim_in_%d_%d", - ist->file_index, ist->index); + f->index, ist->index); if (copy_ts) { tsoffset = f->start_time == AV_NOPTS_VALUE ? 0 : f->start_time; if (!start_at_zero && f->ctx->start_time != AV_NOPTS_VALUE) @@ -1585,7 +1585,7 @@ static int configure_input_audio_filter(FilterGraph *fg, AVFilterGraph *graph, AVFilterContext *last_filter; const AVFilter *abuffer_filt = avfilter_get_by_name("abuffer"); InputStream *ist = ifp->ist; - InputFile *f = input_files[ist->file_index]; + InputFile *f = ist->file; AVBPrint args; char name[255]; int ret, pad_idx = 0; @@ -1610,7 +1610,7 @@ static int configure_input_audio_filter(FilterGraph *fg, AVFilterGraph *graph, } else av_bprintf(&args, ":channels=%d", ifp->ch_layout.nb_channels); snprintf(name, sizeof(name), "graph_%d_in_%d_%d", fg->index, - ist->file_index, ist->index); + f->index, ist->index); if ((ret = avfilter_graph_create_filter(&ifp->filter, abuffer_filt, name, args.str, NULL, @@ -1619,7 +1619,7 @@ static int configure_input_audio_filter(FilterGraph *fg, AVFilterGraph *graph, last_filter = ifp->filter; snprintf(name, sizeof(name), "trim for input stream %d:%d", - ist->file_index, ist->index); + f->index, ist->index); if (copy_ts) { tsoffset = f->start_time == AV_NOPTS_VALUE ? 0 : f->start_time; if (!start_at_zero && f->ctx->start_time != AV_NOPTS_VALUE) @@ -2572,7 +2572,7 @@ static int send_eof(FilterGraphThread *fgt, InputFilter *ifilter, if (ifp->format < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", - ifp->ist->file_index, ifp->ist->index); + ifp->ist->file->index, ifp->ist->index); return AVERROR_INVALIDDATA; } } |