summaryrefslogtreecommitdiffstats
path: root/player/core.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-09 01:20:36 +0100
committerwm4 <wm4@nowhere>2014-03-09 01:27:42 +0100
commit7b6e211e63e3cc3e53cc58360b9067f98489d892 (patch)
treeaf56949fd8ac2f77fea2189539cb527960e4e9c2 /player/core.h
parente16c91d07ab2acfb83fdeaa6dcfcd25c97666504 (diff)
downloadmpv-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 'player/core.h')
-rw-r--r--player/core.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/player/core.h b/player/core.h
index 5e60568c97..5927091233 100644
--- a/player/core.h
+++ b/player/core.h
@@ -225,8 +225,6 @@ typedef struct MPContext {
struct ao *ao;
double ao_pts;
struct mp_audio_buffer *ao_buffer; // queued audio; passed to ao_play() later
- int ao_buffer_playable_samples; // part of the part of the buffer the AO
- // hasn't accepted yet with play()
struct vo *video_out;