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_dec.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_dec.c')
-rw-r--r-- | fftools/ffmpeg_dec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fftools/ffmpeg_dec.c b/fftools/ffmpeg_dec.c index ce5aa33f73..5d4ef7909c 100644 --- a/fftools/ffmpeg_dec.c +++ b/fftools/ffmpeg_dec.c @@ -194,7 +194,7 @@ static void audio_ts_process(void *logctx, Decoder *d, AVFrame *frame) static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *frame) { const Decoder *d = ist->decoder; - const InputFile *ifile = input_files[ist->file_index]; + const InputFile *ifile = ist->file; int64_t codec_duration = 0; // XXX lavf currently makes up frame durations when they are not provided by @@ -456,7 +456,7 @@ static int transcode_subtitles(InputStream *ist, const AVPacket *pkt, static int packet_decode(InputStream *ist, AVPacket *pkt, AVFrame *frame) { - const InputFile *ifile = input_files[ist->file_index]; + const InputFile *ifile = ist->file; Decoder *d = ist->decoder; AVCodecContext *dec = ist->dec_ctx; const char *type_desc = av_get_media_type_string(dec->codec_type); @@ -512,7 +512,7 @@ static int packet_decode(InputStream *ist, AVPacket *pkt, AVFrame *frame) update_benchmark(NULL); ret = avcodec_receive_frame(dec, frame); update_benchmark("decode_%s %d.%d", type_desc, - ist->file_index, ist->index); + ifile->index, ist->index); if (ret == AVERROR(EAGAIN)) { av_assert0(pkt); // should never happen during flushing @@ -558,7 +558,7 @@ static int packet_decode(InputStream *ist, AVPacket *pkt, AVFrame *frame) ret = video_frame_process(ist, frame); if (ret < 0) { av_log(NULL, AV_LOG_FATAL, "Error while processing the decoded " - "data for stream #%d:%d\n", ist->file_index, ist->index); + "data for stream #%d:%d\n", ifile->index, ist->index); return ret; } } @@ -576,7 +576,7 @@ static int packet_decode(InputStream *ist, AVPacket *pkt, AVFrame *frame) static void dec_thread_set_name(const InputStream *ist) { char name[16]; - snprintf(name, sizeof(name), "dec%d:%d:%s", ist->file_index, ist->index, + snprintf(name, sizeof(name), "dec%d:%d:%s", ist->file->index, ist->index, ist->dec_ctx->codec->name); ff_thread_setname(name); } |