aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.cpp b/linden/indra/llmedia/llmediaimplgstreamer.cpp
index 952e22f..8ffb7c8 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.cpp
+++ b/linden/indra/llmedia/llmediaimplgstreamer.cpp
@@ -657,8 +657,7 @@ bool LLMediaImplGStreamer::stop()
657 657
658 state_change = gst_element_set_state(mPlaybin, GST_STATE_READY); 658 state_change = gst_element_set_state(mPlaybin, GST_STATE_READY);
659 659
660 LL_DEBUGS("MediaImpl") << "result: " 660 LL_DEBUGS("MediaImpl") << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
661 << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
662 661
663 if (state_change == GST_STATE_CHANGE_FAILURE) 662 if (state_change == GST_STATE_CHANGE_FAILURE)
664 { 663 {
@@ -667,7 +666,8 @@ bool LLMediaImplGStreamer::stop()
667 } 666 }
668 else 667 else
669 { 668 {
670 mState = GST_STATE_READY; 669 // Going into pending after play keeps dead streams from looping
670 (mState == GST_STATE_PLAYING) ? (mState = GST_STATE_VOID_PENDING) : (mState = GST_STATE_READY);
671 return true; 671 return true;
672 } 672 }
673} 673}
@@ -684,23 +684,23 @@ bool LLMediaImplGStreamer::play()
684 GstStateChangeReturn state_change; 684 GstStateChangeReturn state_change;
685 685
686 state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING); 686 state_change = gst_element_set_state(mPlaybin, GST_STATE_PLAYING);
687 mState = GST_STATE_PLAYING;
687 688
688 LL_DEBUGS("MediaImpl") << "result: " 689 LL_DEBUGS("MediaImpl") << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
689 << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
690 690
691 // Check to make sure playing was successful. If not, stop. 691 // Check to make sure playing was successful. If not, stop.
692 // NOTE: state_change is almost always GST_STATE_CHANGE_ASYNC 692 // NOTE: state_change is almost always GST_STATE_CHANGE_ASYNC
693 if (state_change == GST_STATE_CHANGE_FAILURE) 693 if (state_change == GST_STATE_CHANGE_FAILURE)
694 { 694 {
695 // If failing from a bad stream, go into pending state 695 // If failing from a bad stream, go into an unknown
696 // (this is stopped at the callback) 696 // state to stop bus_callback from looping back.
697 mState = GST_STATE_VOID_PENDING; 697 // We also force a stop in case the operations don't sync
698 setStatus(LLMediaBase::STATUS_UNKNOWN);
698 stop(); 699 stop();
699 return false; 700 return false;
700 } 701 }
701 else 702 else
702 { 703 {
703 mState = GST_STATE_PLAYING;
704 return true; 704 return true;
705 } 705 }
706} 706}
@@ -718,8 +718,7 @@ bool LLMediaImplGStreamer::pause()
718 718
719 state_change = gst_element_set_state(mPlaybin, GST_STATE_PAUSED); 719 state_change = gst_element_set_state(mPlaybin, GST_STATE_PAUSED);
720 720
721 LL_DEBUGS("MediaImpl") << "result: " 721 LL_DEBUGS("MediaImpl") << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
722 << gst_element_state_change_return_get_name(state_change) << LL_ENDL;
723 722
724 if (state_change == GST_STATE_CHANGE_FAILURE) 723 if (state_change == GST_STATE_CHANGE_FAILURE)
725 { 724 {