summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-14 21:32:39 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-12-14 21:40:14 +0200
commit341db56df17d74a22c0ff01b1a1e816d6f6624a7 (patch)
treec312c8946037beb0761a61f757ada2f0881e50ac /indra
parente55a0510ff0146ec0f1ae60c8c97c3815ad5b0dd (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.cpp17
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;
+ }
+ }
};
};