From 0a9ab1b076fa43cfbdfa7aee01d723fe400396fd Mon Sep 17 00:00:00 2001 From: tomty89 Date: Wed, 24 Jan 2018 14:21:52 +0800 Subject: ao_opensles: remove set_play_state() Set play state to playing in init() instead. We no longer touch the play state afterwards. --- audio/out/ao_opensles.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'audio') diff --git a/audio/out/ao_opensles.c b/audio/out/ao_opensles.c index bff94b29e2..e92b530938 100644 --- a/audio/out/ao_opensles.c +++ b/audio/out/ao_opensles.c @@ -198,6 +198,7 @@ static int init(struct ao *ao) (void*)&p->buffer_queue)); CHK((*p->buffer_queue)->RegisterCallback(p->buffer_queue, buffer_callback, ao)); + CHK((*p->play)->SetPlayState(p->play, SL_PLAYSTATE_PLAYING)); return 1; error: @@ -207,14 +208,6 @@ error: #undef CHK -static void set_play_state(struct ao *ao, SLuint32 state) -{ - struct priv *p = ao->priv; - SLresult res = (*p->play)->SetPlayState(p->play, state); - if (res != SL_RESULT_SUCCESS) - MP_ERR(ao, "Failed to SetPlayState(%d): %d\n", state, res); -} - static void reset(struct ao *ao) { struct priv *p = ao->priv; @@ -224,8 +217,6 @@ static void reset(struct ao *ao) static void resume(struct ao *ao) { struct priv *p = ao->priv; - set_play_state(ao, SL_PLAYSTATE_PLAYING); - // enqueue two buffers buffer_callback(p->buffer_queue, ao); buffer_callback(p->buffer_queue, ao); -- cgit v1.2.3