-
Notifications
You must be signed in to change notification settings - Fork 605
MediaPlayer aborted with Promise already satisfied #187
Comments
@paragone can you tell what were you trying to play, so that we can reproduce the issue. |
Hi @paragone , this has been observed and it will be resolved in our future release. Please refer to #153 and the solution there. Below is the snippet of the temporary solution from #153: It looks like the crash is occurring because m_playlistParsedPromise in MediaPlayer/URLSource is being set twice. In MediaPlayer/include/UrlSource.h, could you add a boolean flag that indicates whether a callback has been received, as well as a mutex? For example, bool m_hasReceivedAPlaylistCallback and std::mutex m_mutex. Then in URLSource's constructor, initialize m_hasReceivedAPlaylistCallback to false. Finally, in UrlSource::onPlaylistParsed, you could add something like the following: std::lock_guardstd::mutex lock{m_mutex}; |
hi mradulan, |
@mradulan 2017-09-26 07:20:08.058 [] W DirectiveRouter:preHandleDirectiveFailed:messageId=e3652dc0-34dc-473b-ac0a-ac7336908c3f,reason=noHandlerRegistered promise here is a local variable `MediaPlayerStatus MediaPlayer::play() { auto stateChangeRet = gst_element_set_state(m_pipeline.pipeline, GST_STATE_PLAYING); waiting for you reply online............ |
which part of the debug code are you printing "promise set value 37" and "promise set value 37" |
@Roy20141120 , does it play any music for you and then it terminates with the error? It seems like the music never gets played because you get MediaPlayer:handlePlay:stateReturn=ASYNC |
Hi @paragone and @Roy20141120, there have been quite a few changes to MediaPlayer and AudioPlayer in release v1.1.0. Could you try your test case with this latest release and see if you are still seeing the issue? Thanks! |
I test it with the latest release and it still exists,here is the log: 2017-10-12 09:14:28.333 [] 0 EventBuilder:buildJsonEventString:messageId=1036b6b1-821f-4e00-b1d3-606f97164775,namespace=System,name=ExceptionEncountered |
Hi @paragone, Our MediaPlayer component has gone through several big changes over the last 2 releases. Could you try again and see if the issue is still persisting? I'm going to close this issue for now since it's a bit stale, but please reopen if you're still seeing the issue. Thanks, |
hi,I got a problem while playing with MediaPlayer. log:
2017-09-25 06:16:27.288 [] I DirectiveSequencer:onDirective:directive={"namespace:"TemplateRuntime",name:"RenderPlayerInfo",messageId:"17a1c325-82b3-46c1-983d-57f7c8cac5a5",dialogRequestId:"4949f1d2-be01-4ec6-90e8-19caf668cd6f"}
2017-09-25 06:16:27.288 [] 9 MediaPlayer:playCalled
2017-09-25 06:16:27.288 [] W DirectiveRouter:preHandleDirectiveFailed:messageId=17a1c325-82b3-46c1-983d-57f7c8cac5a5,reason=noHandlerRegistered
2017-09-25 06:16:27.289 [] I DirectiveSequencer:sendingExceptionEncountered:messageId=17a1c325-82b3-46c1-983d-57f7c8cac5a5
2017-09-25 06:16:27.289 [] 0 MediaPlayer:handlePlayCalled
2017-09-25 06:16:27.289 [] 0 MediaPlayer:doStopSuccess:reason=alreadyStopped
2017-09-25 06:16:27.289 [] 9 MediaPlayer:doStopSuccess
2017-09-25 06:16:27.289 [] 0 MediaPlayer:handlePlay:supportsBuffering=0
2017-09-25 06:16:27.289 [] 0 EventBuilder:buildJsonEventString:messageId=4fc51536-7ec1-4a6f-91c2-1d7596863956,namespace=System,name=ExceptionEncountered
2017-09-25 06:16:27.295 [] 0 MediaPlayer:handlePlay:stateReturn=ASYNC
2017-09-25 06:16:27.295 [] 0 MediaPlayer:handlePlay:stateReturn11111=ASYNC
terminate called after throwing an instance of 'std::future_error'
what(): Promise already satisfied
Aborted
i add some logs,code,here is code:
auto stateChangeRet = gst_element_set_state(m_pipeline.pipeline, GST_STATE_PLAYING);
ACSDK_DEBUG(LX("handlePlay").d("stateReturn", gst_element_state_change_return_get_name(stateChangeRet)));
if (GST_STATE_CHANGE_FAILURE == stateChangeRet) {
ACSDK_ERROR(LX("handlePlayFailed").d("reason", "gstElementSetStateFailure"));
promise->set_value(MediaPlayerStatus::FAILURE);
} else if (GST_STATE_CHANGE_ASYNC == stateChangeRet) {
ACSDK_DEBUG(LX("handlePlay").d("stateReturn11111", gst_element_state_change_return_get_name(stateChangeRet)));
promise->set_value(MediaPlayerStatus::PENDING);
ACSDK_DEBUG(LX("handlePlay").d("stateReturn22222", gst_element_state_change_return_get_name(stateChangeRet)));
} else {
ACSDK_DEBUG(LX("handlePlay").d("stateReturn33333", gst_element_state_change_return_get_name(stateChangeRet)));
promise->set_value(MediaPlayerStatus::SUCCESS);
ACSDK_DEBUG(LX("handlePlay").d("stateReturn44444", gst_element_state_change_return_get_name(stateChangeRet)));
}
ACSDK_DEBUG(LX("handlePlay").d("stateReturn55555", gst_element_state_change_return_get_name(stateChangeRet)));
hope you can give me some advice.
The text was updated successfully, but these errors were encountered: