[vlc-commits] auhal: do not stop and restart audio unit on flush
David Fuhrmann
git at videolan.org
Tue Nov 26 23:05:38 CET 2013
vlc/vlc-2.1 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Tue Nov 26 19:40:09 2013 +0100| [06631f06f0c78b8ee12e93f6f36c75e0e0334c7e] | committer: David Fuhrmann
auhal: do not stop and restart audio unit on flush
This is a manual revert of 878169fe, which is not needed anymore.
Additionally, it fixes blayback with devices which are not fast
enough for starting up.
close #9886
(cherry picked from commit 1f46c35a5aa44fd1c32b49c65500e37d795f1a91)
Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=06631f06f0c78b8ee12e93f6f36c75e0e0334c7e
---
modules/audio_output/auhal.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/modules/audio_output/auhal.c b/modules/audio_output/auhal.c
index a300aa3..bf8cccc 100644
--- a/modules/audio_output/auhal.c
+++ b/modules/audio_output/auhal.c
@@ -103,9 +103,6 @@ struct aout_sys_t
bool b_revert; /* Whether we need to revert the stream format */
bool b_changed_mixing; /* Whether we need to set the mixing mode back */
-
- bool b_got_first_sample; /* did the aout core provide something to render? */
-
int i_rate; /* media sample rate */
int i_bytes_per_sample;
@@ -828,7 +825,7 @@ static int StartAnalog(audio_output_t *p_aout, audio_sample_format_t *fmt)
TPCircularBufferInit(&p_sys->circular_buffer, AUDIO_BUFFER_SIZE_IN_SECONDS *
fmt->i_rate * fmt->i_bytes_per_frame);
- p_sys->b_got_first_sample = false;
+ verify_noerr(AudioOutputUnitStart(p_sys->au_unit));
/* Set volume for output unit */
VolumeSet(p_aout, p_sys->f_volume);
@@ -1348,12 +1345,6 @@ static void Play(audio_output_t * p_aout, block_t * p_block)
struct aout_sys_t *p_sys = p_aout->sys;
if (p_block->i_nb_samples > 0) {
- if (!p_sys->b_got_first_sample) {
- /* Start the AU */
- verify_noerr(AudioOutputUnitStart(p_sys->au_unit));
- p_sys->b_got_first_sample = true;
- }
-
/* Do the channel reordering */
if (p_sys->chans_to_reorder && !p_sys->b_digital) {
aout_ChannelReorder(p_block->p_buffer,
@@ -1407,10 +1398,7 @@ static void Flush(audio_output_t *p_aout, bool wait)
vlc_mutex_unlock(&p_sys->lock);
} else {
- p_sys->b_got_first_sample = false;
-
/* flush circular buffer */
- AudioOutputUnitStop(p_aout->sys->au_unit);
TPCircularBufferClear(&p_aout->sys->circular_buffer);
}
}
More information about the vlc-commits
mailing list