summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_stream.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffmpeg_stream.cc')
-rw-r--r--src/lib/ffmpeg_stream.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_stream.cc b/src/lib/ffmpeg_stream.cc
index 085c78fa8..7a8748e4e 100644
--- a/src/lib/ffmpeg_stream.cc
+++ b/src/lib/ffmpeg_stream.cc
@@ -62,3 +62,18 @@ FFmpegStream::stream (AVFormatContext const * fc) const
DCPOMATIC_ASSERT (false);
return 0;
}
+
+int
+FFmpegStream::index (AVFormatContext const * fc) const
+{
+ size_t i = 0;
+ while (i < fc->nb_streams) {
+ if (fc->streams[i]->id == _id) {
+ return i;
+ }
+ ++i;
+ }
+
+ DCPOMATIC_ASSERT (false);
+ return 0;
+}