From: Carl Hetherington Date: Wed, 18 Dec 2013 21:24:17 +0000 (+0000) Subject: A couple of sndfile fixes for the new world order. X-Git-Tag: v2.0.48~922^2~45 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=ff1ab29c3ea270061a54bde529270953e14b9adc;hp=de68adffc0311511568484e9ab713bee8826ec2d;p=dcpomatic.git A couple of sndfile fixes for the new world order. --- diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index b2e8cc44a..866d846db 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -141,13 +141,6 @@ FFmpegDecoder::flush () if (_ffmpeg_content->audio_stream() && _decode_audio) { decode_audio_packet (); } - -#if 0 - /* XXX */ - /* Stop us being asked for any more data */ - _video_position = _ffmpeg_content->video_length (); - _audio_position = _ffmpeg_content->audio_length (); -#endif } bool diff --git a/src/lib/sndfile_decoder.cc b/src/lib/sndfile_decoder.cc index 3af683c57..432f73f0d 100644 --- a/src/lib/sndfile_decoder.cc +++ b/src/lib/sndfile_decoder.cc @@ -94,7 +94,7 @@ SndfileDecoder::pass () } data->set_frames (this_time); - audio (data, _done); + audio (data, _done * TIME_HZ / audio_frame_rate ()); _done += this_time; _remaining -= this_time; @@ -123,6 +123,7 @@ void SndfileDecoder::seek (ContentTime t, bool accurate) { Decoder::seek (t, accurate); - - /* XXX */ + + _done = t * audio_frame_rate() / TIME_HZ; + _remaining = _info.frames - _done; }