diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-11 12:57:53 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-11 12:57:53 +0100 |
| commit | 49deab5be257f3a11f5b053224f4a3218fad8da3 (patch) | |
| tree | edb4593b33d2a062614cdfaba9cc96d4aab8c1ed /src/lib/player.cc | |
| parent | cb2d996875db099ce456c18e9751f5dfe3d9056d (diff) | |
Untested flushing of resamplers.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index 467f92374..18c42296f 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -261,7 +261,11 @@ Player::process_audio (weak_ptr<Piece> weak_piece, shared_ptr<const AudioBuffers assert (content); if (content->content_audio_frame_rate() != content->output_audio_frame_rate()) { - audio = resampler(content)->run (audio); + shared_ptr<Resampler> r = resampler (content); + audio = r->run (audio); + _last_resampler = r; + } else { + _last_resampler.reset (); } /* Remap channels */ @@ -313,6 +317,12 @@ Player::flush () _audio_buffers.set_frames (0); } + if (_last_resampler) { + shared_ptr<const AudioBuffers> resamp = _last_resampler->flush (); + Audio (resamp, _audio_position); + _audio_position += _film->audio_frames_to_time (resamp->frames ()); + } + while (_video_position < _audio_position) { emit_black (); } |
