summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_stream.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-07-28 00:44:40 +0100
committerCarl Hetherington <cth@carlh.net>2016-07-28 00:44:40 +0100
commit2704fe5ce4ecfcb9214c032117be719079b93d89 (patch)
treefe1be9a0b2d68892a20ce96f50965ba95b85992b /src/lib/ffmpeg_stream.cc
parentd6d3c4648cc21e3a48f32eeab7df0c5a4e24f2f9 (diff)
Fix start-trim of audio-only content (#915).
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;
+}