ao_opensles: remove set_play_state()

Set play state to playing in init() instead. We no longer touch the play state afterwards.
This commit is contained in:
tomty89 2018-01-24 14:21:52 +08:00 committed by Jan Ekström
parent ba68e570de
commit 0a9ab1b076
1 changed files with 1 additions and 10 deletions

View File

@ -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);