From 341db56df17d74a22c0ff01b1a1e816d6f6624a7 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 14 Dec 2021 21:32:39 +0200 Subject: SL-16510 fix vlc not restoring position after a resize --- indra/media_plugins/libvlc/media_plugin_libvlc.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'indra') 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; + } + } }; }; -- cgit v1.2.3