diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-05-07 08:43:22 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-05-10 07:49:01 +0200 |
commit | 9825d488d6fdfb7c14d2d702d1a890311f5b2943 (patch) | |
tree | 1af99774655a8bd0815387651eeab1d853364ca8 /libavformat/demux_utils.c | |
parent | 493356cc0bd8386a247ed79e4ea381e8fbdbd057 (diff) | |
download | ffmpeg-9825d488d6fdfb7c14d2d702d1a890311f5b2943.tar.gz |
avformat/utils: Move ff_find_stream_index to demux_utils.c
It is only used by demuxers (and it is generally demuxers
who have to translate format-specific IDs to stream indices).
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/demux_utils.c')
-rw-r--r-- | libavformat/demux_utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/demux_utils.c b/libavformat/demux_utils.c index a59476e0da..56cc6e15d8 100644 --- a/libavformat/demux_utils.c +++ b/libavformat/demux_utils.c @@ -367,3 +367,11 @@ int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int return ret; } + +int ff_find_stream_index(const AVFormatContext *s, int id) +{ + for (unsigned i = 0; i < s->nb_streams; i++) + if (s->streams[i]->id == id) + return i; + return -1; +} |