summaryrefslogtreecommitdiff
path: root/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-12-09 18:49:48 +0200
committerandreykproductengine <akleshchev@productengine.com>2016-12-09 18:49:48 +0200
commit8d34a4f8c12d624deb72878d7a6682e306f71d1a (patch)
tree7d9fb26510c27951680fabc4a22acd7a19a62a57 /indra/media_plugins/libvlc/media_plugin_libvlc.cpp
parentb6dc755786fb06ab109eb36f402a25edaf24ce14 (diff)
MAINT-6840 start and pause doesn't wotk reliably and can get stuck
Diffstat (limited to 'indra/media_plugins/libvlc/media_plugin_libvlc.cpp')
-rw-r--r--indra/media_plugins/libvlc/media_plugin_libvlc.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
index 0bd323eb58..ebcdde2960 100644
--- a/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
+++ b/indra/media_plugins/libvlc/media_plugin_libvlc.cpp
@@ -84,6 +84,7 @@ private:
float mCurTime;
float mDuration;
+ EStatus mVlcStatus;
};
////////////////////////////////////////////////////////////////////////////////
@@ -111,6 +112,7 @@ MediaPluginBase(host_send_func, host_user_data)
mURL = std::string();
+ mVlcStatus = STATUS_NONE;
setStatus(STATUS_NONE);
}
@@ -209,28 +211,28 @@ void MediaPluginLibVLC::eventCallbacks(const libvlc_event_t* event, void* ptr)
switch (event->type)
{
case libvlc_MediaPlayerOpening:
- parent->setStatus(STATUS_LOADING);
+ parent->mVlcStatus = STATUS_LOADING;
break;
case libvlc_MediaPlayerPlaying:
parent->mDuration = (float)(libvlc_media_get_duration(parent->mLibVLCMedia)) / 1000.0f;
- parent->setStatus(STATUS_PLAYING);
+ parent->mVlcStatus = STATUS_PLAYING;
break;
case libvlc_MediaPlayerPaused:
- parent->setStatus(STATUS_PAUSED);
+ parent->mVlcStatus = STATUS_PAUSED;
break;
case libvlc_MediaPlayerStopped:
- parent->setStatus(STATUS_DONE);
+ parent->mVlcStatus = STATUS_DONE;
break;
case libvlc_MediaPlayerEndReached:
- parent->setStatus(STATUS_DONE);
+ parent->mVlcStatus = STATUS_DONE;
break;
case libvlc_MediaPlayerEncounteredError:
- parent->setStatus(STATUS_ERROR);
+ parent->mVlcStatus = STATUS_ERROR;
break;
case libvlc_MediaPlayerTimeChanged:
@@ -446,6 +448,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
}
else if (message_name == "idle")
{
+ setStatus(mVlcStatus);
}
else if (message_name == "cleanup")
{
@@ -567,7 +570,7 @@ void MediaPluginLibVLC::receiveMessage(const char* message_string)
{
if (mLibVLCMediaPlayer)
{
- libvlc_media_player_pause(mLibVLCMediaPlayer);
+ libvlc_media_player_set_pause(mLibVLCMediaPlayer, 1);
}
}
else if (message_name == "seek")