Rename TYPE_DEBUG_PLAYER to TYPE_DEBUG_VIDEO_VIEW.
[dcpomatic.git] / src / lib / ffmpeg_stream.cc
index 085c78fa8427d21d1f367143bcf90d11c07bcd41..86108ce4d1ea24ab38bf5ed29634344608376e1f 100644 (file)
 
 #include "ffmpeg_stream.h"
 #include "dcpomatic_assert.h"
-#include "raw_convert.h"
+#include <dcp/raw_convert.h>
 #include <libxml++/libxml++.h>
 extern "C" {
 #include <libavformat/avformat.h>
 }
 
 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;
+}