diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-10-22 14:35:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-10-22 14:35:00 +0100 |
| commit | 71b7808830e17423453502ed5112b70bf90fff1b (patch) | |
| tree | 0523f5017e391a1d93df8a5a657d1e09c7998b4e /src/lib/decoder.cc | |
| parent | a747cef99d7e45d1971b9811c7cf23b4cc91a1b4 (diff) | |
Do audio/video pts sync in a hopefully much more sensible way.
Diffstat (limited to 'src/lib/decoder.cc')
| -rw-r--r-- | src/lib/decoder.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index c9235f8e1..65e5ff722 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -90,12 +90,10 @@ Decoder::~Decoder () void Decoder::process_begin () { - _delay_in_bytes = _fs->total_audio_delay() * _fs->audio_sample_rate() * _fs->audio_channels() * bytes_per_audio_sample() / 1000; + _delay_in_bytes = _fs->audio_delay() * _fs->audio_sample_rate() * _fs->audio_channels() * bytes_per_audio_sample() / 1000; delete _delay_line; _delay_line = new DelayLine (_delay_in_bytes); - _log->log (String::compose ("Decoding audio with total delay of %1", _fs->total_audio_delay())); - _audio_frames_processed = 0; } @@ -129,6 +127,10 @@ Decoder::process_end () _log->log (String::compose ("DCP length is %1; %2 frames of audio processed.", _fs->dcp_length(), _audio_frames_processed)); _log->log (String::compose ("Adding %1 frames of silence to the end.", audio_short_by_frames)); + /* XXX: this is slightly questionable; does memset () give silence with all + sample formats? + */ + int64_t bytes = audio_short_by_frames * _fs->audio_channels() * bytes_per_audio_sample(); int64_t const silence_size = 16 * 1024 * _fs->audio_channels() * bytes_per_audio_sample(); |
