Don't decode subtitles if they are not enabled.
authorCarl Hetherington <cth@carlh.net>
Sun, 28 Jul 2013 15:42:46 +0000 (16:42 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 28 Jul 2013 15:42:46 +0000 (16:42 +0100)
src/lib/ffmpeg_decoder.cc

index ddc9e71a073814cda61779d94b4b570e458770d5..ceb14bacc3b442056cd21c096f814fd9e6e08a0e 100644 (file)
@@ -166,11 +166,14 @@ FFmpegDecoder::pass ()
 
        avcodec_get_frame_defaults (_frame);
 
+       shared_ptr<const Film> film = _film.lock ();
+       assert (film);
+       
        if (_packet.stream_index == _video_stream && _decode_video) {
                decode_video_packet ();
        } else if (_ffmpeg_content->audio_stream() && _packet.stream_index == _ffmpeg_content->audio_stream()->id && _decode_audio) {
                decode_audio_packet ();
-       } else if (_ffmpeg_content->subtitle_stream() && _packet.stream_index == _ffmpeg_content->subtitle_stream()->id) {
+       } else if (_ffmpeg_content->subtitle_stream() && _packet.stream_index == _ffmpeg_content->subtitle_stream()->id && film->with_subtitles ()) {
                decode_subtitle_packet ();
        }