diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-02-23 21:40:16 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-04-19 23:04:32 +0100 |
| commit | 91a5bd51ff9278038eaf2658142168cf8120fd75 (patch) | |
| tree | 7f09929870acaa26babe0679b26ea71cbf950cb3 /src/lib | |
| parent | f0259b7bf90a69e7595d19cf59404591157388d5 (diff) | |
Don't emit zero-sample buffers.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index dffe7dbee..7d8add416 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -545,9 +545,12 @@ Player::pass () DCPTime t = _last_audio_time; while (t < length) { DCPTime block = min (DCPTime::from_seconds (0.5), length - t); - shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->audio_channels(), block.frames_round(_film->audio_frame_rate()))); - silence->make_silent (); - Audio (silence, t); + Frame const samples = block.frames_round(_film->audio_frame_rate()); + if (samples) { + shared_ptr<AudioBuffers> silence (new AudioBuffers (_film->audio_channels(), samples)); + silence->make_silent (); + Audio (silence, t); + } t += block; } |
