diff options
author | wm4 <wm4@nowhere> | 2014-03-09 01:20:36 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-03-09 01:27:42 +0100 |
commit | 7b6e211e63e3cc3e53cc58360b9067f98489d892 (patch) | |
tree | af56949fd8ac2f77fea2189539cb527960e4e9c2 /options/m_option.c | |
parent | e16c91d07ab2acfb83fdeaa6dcfcd25c97666504 (diff) | |
download | mpv-7b6e211e63e3cc3e53cc58360b9067f98489d892.tar.bz2 mpv-7b6e211e63e3cc3e53cc58360b9067f98489d892.tar.xz |
audio: remove handling of partially written data
Remove the ao_buffer_playable_samples field. This contained the number
of samples that fill_audio_out_buffers() wanted to write to the AO (i.e.
this data was supposed to be played at some point), but ao_play()
rejected it due to partial fill.
This could happen with many AOs, notably those which align all written
data to an internal period size (often called "outburst" in the AO
code), and the accepted number of samples is rounded down to period
boundaries. The left-over samples at the end were still kept in
mpctx->ao_buffer, and had to be played later.
The reason ao_buffer_playable_samples had to exist was to make sure that
at EOF, the correct number of left-over samples was played (and not
possibly other data in the buffer that had to be sliced off due to
endpts in fill_audio_out_buffers()). (You'd think you could just slice
the entire buffer, but I suspect this wasn't done because the end time
could actually change due to A/V sync changes. Maybe that was the reason
it's so complicated.)
Some commits ago, ao.c gained internal buffering, and ao_play() will
never return partial writes - as long as you don't try to write more
samples than ao_get_space() reports. This is always the case. The only
exception is filling the audio buffers while paused. In this case, we
decode and play only 1 sample in order to initialize decoding (e.g. on
seeking). Actually playing this 1 sample is in fact a bug, but even of
the AO doesn't have period size alignment, you won't notice it. In
summary, this means we can safely remove the code.
Diffstat (limited to 'options/m_option.c')
0 files changed, 0 insertions, 0 deletions