X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_stream.cc;h=86108ce4d1ea24ab38bf5ed29634344608376e1f;hb=083f242875671739241ad8bf7e6f436959b5d677;hp=085c78fa8427d21d1f367143bcf90d11c07bcd41;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/lib/ffmpeg_stream.cc b/src/lib/ffmpeg_stream.cc index 085c78fa8..86108ce4d 100644 --- a/src/lib/ffmpeg_stream.cc +++ b/src/lib/ffmpeg_stream.cc @@ -20,13 +20,14 @@ #include "ffmpeg_stream.h" #include "dcpomatic_assert.h" -#include "raw_convert.h" +#include #include extern "C" { #include } using std::string; +using dcp::raw_convert; FFmpegStream::FFmpegStream (cxml::ConstNodePtr node) : name (node->string_child ("Name")) @@ -62,3 +63,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; +}