summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-29 12:42:45 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-29 12:42:45 +0100
commita4e7f2fe00fcec204de6562d0b8eba9ca80207cd (patch)
tree4b580c97a0def1c27a51ec5ce7ade7479ab8dc1e /src/lib/ffmpeg_decoder.cc
parent48960815fe8edbb0f6b0f14cb1339d66e76a370b (diff)
Fix _audio_pts_offset setup when we are only processing audio.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index ede724b5f..8da607e7e 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -97,6 +97,8 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> f, shared_ptr<const FFmpegC
_video_pts_offset = _audio_pts_offset = - min (c->first_video().get(), c->audio_stream()->first_audio.get());
} else if (have_video) {
_video_pts_offset = - c->first_video().get();
+ } else if (have_audio) {
+ _audio_pts_offset = - c->audio_stream()->first_audio.get();
}
/* Now adjust both so that the video pts starts on a frame */
@@ -385,7 +387,7 @@ FFmpegDecoder::decode_audio_packet ()
/* Where we are in the source, in seconds */
double const pts = av_q2d (_format_context->streams[copy_packet.stream_index]->time_base)
* av_frame_get_best_effort_timestamp(_frame) + _audio_pts_offset;
-
+
if (pts > 0) {
/* Emit some silence */
shared_ptr<AudioBuffers> silence (