Merge.
[dcpomatic.git] / src / lib / ffmpeg.cc
index e5e5f317a0efeea02dda41588685e1e2d58d3fe7..b7ae04b069017d8404325939fdbbad8ba4108f26 100644 (file)
@@ -62,7 +62,7 @@ FFmpeg::~FFmpeg ()
                }
        }
 
-       avcodec_free_frame (&_frame);
+       av_frame_free (&_frame);
        
        avformat_close_input (&_format_context);
 }
@@ -136,7 +136,7 @@ FFmpeg::setup_general ()
                }
        }
 
-       _frame = avcodec_alloc_frame ();
+       _frame = av_frame_alloc ();
        if (_frame == 0) {
                throw DecodeError (N_("could not allocate frame"));
        }
@@ -146,7 +146,8 @@ void
 FFmpeg::setup_video ()
 {
        boost::mutex::scoped_lock lm (_mutex);
-       
+
+       assert (_video_stream >= 0);
        AVCodecContext* context = _format_context->streams[_video_stream]->codec;
        AVCodec* codec = avcodec_find_decoder (context->codec_id);