diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-12-14 21:32:39 +0200 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2021-12-14 21:40:14 +0200 |
commit | 341db56df17d74a22c0ff01b1a1e816d6f6624a7 (patch) | |
tree | c312c8946037beb0761a61f757ada2f0881e50ac /indra | |
parent | e55a0510ff0146ec0f1ae60c8c97c3815ad5b0dd (diff) |
SL-16510 fix vlc not restoring position after a resize
Diffstat (limited to 'indra')
-rw-r--r-- | indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp index a49d99bb9b..bbb15c3955 100644 --- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp +++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp @@ -562,7 +562,24 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string) mTextureWidth = texture_width; mTextureHeight = texture_height; + libvlc_time_t time = 1000.0 * mCurTime; + playMedia(); + + if (mLibVLCMediaPlayer) + { + libvlc_media_player_set_time(mLibVLCMediaPlayer, time); + time = libvlc_media_player_get_time(mLibVLCMediaPlayer); + if (time < 0) + { + // -1 if there is no media + mCurTime = 0; + } + else + { + mCurTime = (F64)time / 1000.0; + } + } }; }; |