wip: hacks
[dcpomatic.git] / src / lib / ffmpeg.cc
index 6c8509b6cd71de2eef9e5a75e3c58b2e9f1cd87f..14525c235336acbc6b3ff26c69fc875cc2c1e43b 100644 (file)
@@ -250,11 +250,12 @@ FFmpeg::setup_decoders ()
 AVCodecContext *
 FFmpeg::video_codec_context () const
 {
-       if (!_video_stream) {
+       auto str = _ffmpeg_content->video_stream();
+       if (!str) {
                return nullptr;
        }
 
-       return _codec_context[_video_stream.get()];
+       return _codec_context[str->index(_format_context)];
 }