Android/openslES: start playing, after creating ressources
authorSylvain Becker <sylvain.becker@gmail.com>
Mon, 14 Jan 2019 14:31:06 +0100
changeset 12542c86d239a58f0
parent 12541 f0b89ca0ad7d
child 12543 621d0ce55072
Android/openslES: start playing, after creating ressources
src/audio/openslES/SDL_openslES.c
     1.1 --- a/src/audio/openslES/SDL_openslES.c	Mon Jan 14 12:33:29 2019 +0100
     1.2 +++ b/src/audio/openslES/SDL_openslES.c	Mon Jan 14 14:31:06 2019 +0100
     1.3 @@ -399,13 +399,6 @@
     1.4          /* goto failed; */
     1.5      }
     1.6  
     1.7 -    /* set the player's state to playing */
     1.8 -    result = (*bqPlayerItf)->SetPlayState(bqPlayerItf, SL_PLAYSTATE_PLAYING);
     1.9 -    if (SL_RESULT_SUCCESS != result) {
    1.10 -        LOGE("Play set state failed");
    1.11 -        goto failed;
    1.12 -    }
    1.13 -
    1.14      /* Create the audio buffer semaphore */
    1.15      audiodata->playsem = SDL_CreateSemaphore(NUM_BUFFERS - 1);
    1.16      if (!audiodata->playsem) {
    1.17 @@ -424,6 +417,13 @@
    1.18          audiodata->pmixbuff[i] = audiodata->mixbuff + i * this->spec.size;
    1.19      }
    1.20  
    1.21 +    /* set the player's state to playing */
    1.22 +    result = (*bqPlayerItf)->SetPlayState(bqPlayerItf, SL_PLAYSTATE_PLAYING);
    1.23 +    if (SL_RESULT_SUCCESS != result) {
    1.24 +        LOGE("Play set state failed");
    1.25 +        goto failed;
    1.26 +    }
    1.27 +
    1.28      return 0;
    1.29  
    1.30  failed: