A couple of sndfile fixes for the new world order.
authorCarl Hetherington <cth@carlh.net>
Wed, 18 Dec 2013 21:24:17 +0000 (21:24 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 18 Dec 2013 21:24:17 +0000 (21:24 +0000)
src/lib/ffmpeg_decoder.cc
src/lib/sndfile_decoder.cc

index b2e8cc44a0d56b1c9fe1aa30f10ab122c0fa15d7..866d846db14ebbf801b165b88724b5f77370f22a 100644 (file)
@@ -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
index 3af683c570a89b21a59cf6fd68d8a9f6d37d3fb7..432f73f0d66f5b30e6c8068a13266719cf9c197b 100644 (file)
@@ -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;
 }