From 2704fe5ce4ecfcb9214c032117be719079b93d89 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 28 Jul 2016 00:44:40 +0100 Subject: Fix start-trim of audio-only content (#915). --- src/lib/ffmpeg_stream.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/lib/ffmpeg_stream.cc') 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; +} -- cgit v1.2.3