diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-02-09 22:20:12 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-02-09 22:20:12 +0200 |
commit | 25922d422ac97121ca426e41eb7b7186bac9b1a0 (patch) | |
tree | dde463d42bf66c15a88d95bcc81acdb4bd2ab5c2 /indra | |
parent | 78830a3a403c4884755b237632d78f01d5eaaf44 (diff) |
SL-16827 Play doesn't start audio if audio reached end
Diffstat (limited to 'indra')
-rw-r--r-- | indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index 46ebbd31c5..89144922cc 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -270,6 +270,10 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr) case libvlc_MediaPlayerTimeChanged: parent->mCurTime = (float)libvlc_media_player_get_time(parent->mLibVLCMediaPlayer) / 1000.0f; + if (parent->mVlcStatus == STATUS_DONE && libvlc_media_player_is_playing(parent->mLibVLCMediaPlayer)) + { + parent->mVlcStatus = STATUS_PLAYING; + } parent->setDurationDirty(); break; @@ -630,6 +634,13 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) { if (mLibVLCMediaPlayer) { + if (mVlcStatus == STATUS_DONE && !libvlc_media_player_is_playing(mLibVLCMediaPlayer)) + { + // stop or vlc will ignore 'play', it will just + // make an MediaPlayerEndReached event even if + // seek was used + libvlc_media_player_stop(mLibVLCMediaPlayer); + } libvlc_media_player_play(mLibVLCMediaPlayer); } } |