From 2f99a801dfb1668d7efda4eb8a3f5638d2fe20d2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 27 Jun 2014 11:16:37 +0100 Subject: Fix confusion about subtitle codec pointers. --- src/lib/ffmpeg_decoder.cc | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'src/lib/ffmpeg_decoder.cc') diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 2041a4d17..42be8227e 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -70,8 +70,6 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr c, shared_ptr , SubtitleDecoder (c) , FFmpeg (c) , _log (log) - , _subtitle_codec_context (0) - , _subtitle_codec (0) { /* Audio and video frame PTS values may not start with 0. We want to fiddle them so that: @@ -106,15 +104,6 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr c, shared_ptr } } -FFmpegDecoder::~FFmpegDecoder () -{ - boost::mutex::scoped_lock lm (_mutex); - - if (_subtitle_codec_context) { - avcodec_close (_subtitle_codec_context); - } -} - void FFmpegDecoder::flush () { @@ -382,8 +371,8 @@ FFmpegDecoder::seek_and_flush (ContentTime t) if (audio_codec_context ()) { avcodec_flush_buffers (audio_codec_context ()); } - if (_subtitle_codec_context) { - avcodec_flush_buffers (_subtitle_codec_context); + if (subtitle_codec_context ()) { + avcodec_flush_buffers (subtitle_codec_context ()); } } @@ -508,7 +497,7 @@ FFmpegDecoder::decode_subtitle_packet () { int got_subtitle; AVSubtitle sub; - if (avcodec_decode_subtitle2 (_subtitle_codec_context, &sub, &got_subtitle, &_packet) < 0 || !got_subtitle) { + if (avcodec_decode_subtitle2 (subtitle_codec_context(), &sub, &got_subtitle, &_packet) < 0 || !got_subtitle) { return; } -- cgit v1.2.3