Merge master.
[dcpomatic.git] / src / lib / ffmpeg.cc
index 8505626df1013a980cf6d100fb4246cb147cc302..fa369dda429c9342c2b08eed7a4b74ee50a38c35 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
 #include "ffmpeg.h"
 #include "ffmpeg_content.h"
 #include "ffmpeg_audio_stream.h"
+#include "ffmpeg_subtitle_stream.h"
 #include "exceptions.h"
 #include "util.h"
 
@@ -33,7 +34,6 @@ extern "C" {
 
 using std::string;
 using std::cout;
-using std::stringstream;
 using boost::shared_ptr;
 using dcp::raw_convert;
 
@@ -174,6 +174,16 @@ FFmpeg::audio_codec_context () const
        return _ffmpeg_content->audio_stream()->stream(_format_context)->codec;
 }
 
+AVCodecContext *
+FFmpeg::subtitle_codec_context () const
+{
+       if (!_ffmpeg_content->subtitle_stream ()) {
+               return 0;
+       }
+       
+       return _ffmpeg_content->subtitle_stream()->stream(_format_context)->codec;
+}
+
 int
 FFmpeg::avio_read (uint8_t* buffer, int const amount)
 {