Fix start-trim of audio-only content (#915).
[dcpomatic.git] / src / lib / ffmpeg_stream.cc
index 085c78fa8427d21d1f367143bcf90d11c07bcd41..7a8748e4e3f762f9fe9ea8287b8d8cb6a09cc14f 100644 (file)
@@ -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;
+}