SL-16510 fix vlc not restoring position after a resize

master
Andrey Kleshchev 2021-12-14 21:32:39 +02:00
parent e55a0510ff
commit 341db56df1
1 changed files with 17 additions and 0 deletions

View File

@ -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;
}
}
};
};