Skip to content

ANDROID: MoviePlayerGI does not stop reliably #1678

Open
@eighteight

Description

@eighteight

I play and stop the MoviePlayerGI repeatedly.

  1. Start player -- everything seems fine.
  2. Stop player -- everything is fine.
  3. Start player -- the image is black (but I can hear the sound).
  4. Stop player -- stop does not work (I hear the sound after attempted stop)
  5. Start player === item 1 scenario, except that at this point I still hear the audio from the player started on 3.

This is how I start the player:

float AugmentedTheatreApp::playMovie(const fs::path &moviePath)
{
    try {
        mMovie = cinder::android::video::MovieGl::create( moviePath );
        mMovie->setVolume(mVolume);
        mMovie->setLoop(true);
        mMovie->play();
    }
    catch( ci::Exception &exc ) {
        console() << "Exception caught trying to load the movie from path: " << moviePath << ", what: " << exc.what() << std::endl;
        mMovie.reset();
    }
    
    mVideoTexture.reset();
    return mMovie->getDuration();
}

Stopping the movie player:

void AugmentedTheatreApp::stopMovie()
{
    if (mMovie) {
        mMovie->stop();
    }
    if (mVideoTexture)
        mVideoTexture.reset();
}

The console output

2-08 15:40:45.615 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: VideoPlayer.createFromFilePath
12-08 15:40:45.619 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: VideoPlayer(String filePath): filePath=/storage/emulated/0/Documents/start-360-trailer.mp4
12-08 15:40:45.814 16824-16934/ru.scriptum.at D/MediaPlayer: Couldn't open file on client side, trying server side
12-08 15:40:45.828 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: About to prepare /storage/emulated/0/Documents/start-360-trailer.mp4
12-08 15:40:45.980 16824-16934/ru.scriptum.at E/MediaPlayer: Should have subtitle controller already set
12-08 15:40:45.980 16824-16934/ru.scriptum.at W/Adreno-ES20: <core_glTexImage2D:493>: GL_INVALID_ENUM
12-08 15:40:45.980 16824-16934/ru.scriptum.at I/cinder_app: mCurrentTexture id: 3
12-08 15:40:45.990 16824-17315/ru.scriptum.at E/MediaPlayer: Should have subtitle controller already set
12-08 15:40:45.990 16824-17315/ru.scriptum.at I/libcinder...VideoPlayer: ON PREPARED 
12-08 15:40:46.024 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: initializeTexture: texName=3
12-08 15:40:46.025 16824-16934/ru.scriptum.at I/cinder_app: Video Size: 1920x960
12-08 15:40:46.900 16824-17268/ru.scriptum.at I/cinder: |info   | virtual size_t cinder::audio::android::DeviceManagerOpenSl::getFramesPerBlock(const DeviceRef&)[148] framesPerBlockHardware: 960, framesPerBlockPow2: 1024
12-08 15:40:46.902 16824-16841/ru.scriptum.at W/MediaPlayer: info/warning (3, 0)
12-08 15:40:46.906 16824-16934/ru.scriptum.at W/GLConsumer: [unnamed-16824-0] bindTextureImage: clearing GL error: 0x500

12-08 15:41:44.072 16824-17315/ru.scriptum.at I/libcinder...VideoPlayer:  STOPPED 
12-08 15:41:44.072 16824-16934/ru.scriptum.at I/cinder: STOPPED MOVIE
12-08 15:42:16.377 16824-16934/ru.scriptum.at I/cinder: movie /storage/emulated/0/Documents/start-360-trailer.mp4
12-08 15:42:16.377 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: VideoPlayer.createFromFilePath
12-08 15:42:16.378 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: VideoPlayer(String filePath): filePath=/storage/emulated/0/Documents/start-360-trailer.mp4
12-08 15:42:16.387 16824-16934/ru.scriptum.at D/MediaPlayer: Couldn't open file on client side, trying server side
12-08 15:42:16.392 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: About to prepare /storage/emulated/0/Documents/start-360-trailer.mp4
                                                                         
                                                                         --------- beginning of system
12-08 15:42:16.536 16824-18958/ru.scriptum.at E/MediaPlayer: Should have subtitle controller already set
12-08 15:42:16.536 16824-18958/ru.scriptum.at I/libcinder...VideoPlayer: ON PREPARED 
12-08 15:42:16.536 16824-16934/ru.scriptum.at E/MediaPlayer: Should have subtitle controller already set
12-08 15:42:16.536 16824-16934/ru.scriptum.at W/Adreno-ES20: <core_glTexImage2D:493>: GL_INVALID_ENUM
12-08 15:42:16.536 16824-16934/ru.scriptum.at I/cinder_app: mCurrentTexture id: 5
12-08 15:42:16.539 16824-16934/ru.scriptum.at I/libcinder...VideoPlayer: initializeTexture: texName=5
12-08 15:42:16.539 16824-16934/ru.scriptum.at I/cinder_app: Video Size: 1920x960
12-08 15:42:17.605 16824-16841/ru.scriptum.at E/MediaPlayer: error (1, -38)
12-08 15:42:17.606 16824-16841/ru.scriptum.at E/MediaPlayer: error (1, -38)
12-08 15:42:17.606 16824-17315/ru.scriptum.at E/MediaPlayer: Error (1,-38)
12-08 15:42:17.607 16824-17315/ru.scriptum.at E/MediaPlayer: Error (1,-38)
12-08 15:42:19.066 16824-16840/ru.scriptum.at E/MediaPlayer: error (1, -2147479551)
12-08 15:42:19.067 16824-18958/ru.scriptum.at E/MediaPlayer: Error (1,-2147479551)

12-08 15:42:43.079 16824-16934/ru.scriptum.at I/cinder: STOPPED MOVIE
12-08 15:42:43.080 16824-18958/ru.scriptum.at E/MediaPlayer: stop called in state 0
12-08 15:42:43.080 16824-18958/ru.scriptum.at E/MediaPlayer: error (-38, 0)
12-08 15:42:43.080 16824-18958/ru.scriptum.at I/libcinder...VideoPlayer:  STOPPED 
12-08 15:42:43.080 16824-18958/ru.scriptum.at E/MediaPlayer: Error (-38,0)
  1. Same as 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions