summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-09 20:35:39 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-09 20:35:39 +0100
commit89115db77729a2c99f1a09ff6a461720e16f889e (patch)
treee528ec014b820d4e0efa28893dcee91cd76ee618 /src/lib/ffmpeg_decoder.cc
parentf8ad440cf187c517b7800f3efdfc0954025c4422 (diff)
parentd2ff6a6b0256e256b6df416f280c846072f7682f (diff)
Merge master.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index a3fdaf9b1..bf0949130 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -78,9 +78,6 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> f, shared_ptr<const FFmpegC
double
FFmpegDecoder::compute_pts_offset (double first_video, double first_audio, float video_frame_rate)
{
- assert (first_video >= 0);
- assert (first_audio >= 0);
-
double const old_first_video = first_video;
/* Round the first video to a frame boundary */
@@ -94,6 +91,8 @@ FFmpegDecoder::compute_pts_offset (double first_video, double first_audio, float
FFmpegDecoder::~FFmpegDecoder ()
{
+ boost::mutex::scoped_lock lm (_mutex);
+
if (_subtitle_codec_context) {
avcodec_close (_subtitle_codec_context);
}
@@ -370,17 +369,9 @@ FFmpegDecoder::decode_audio_packet ()
}
}
-
- int const data_size = av_samples_get_buffer_size (
- 0, audio_codec_context()->channels, _frame->nb_samples, audio_sample_format (), 1
- );
-
- assert (audio_codec_context()->channels == _ffmpeg_content->audio_channels());
- audio (deinterleave_audio (_frame->data, data_size), _audio_position);
+ copy_packet.data += decode_result;
+ copy_packet.size -= decode_result;
}
-
- copy_packet.data += decode_result;
- copy_packet.size -= decode_result;
}
}
}