From 2864e81cc02afb7b06047445b8d527f3551eaa7d Mon Sep 17 00:00:00 2001 From: rkandh015 Date: Tue, 28 Jul 2026 18:31:01 +0530 Subject: [PATCH 1/3] Handling pause pause wedge case --- InterfacePlayerRDK.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index a989a41..a5f49f7 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -3471,6 +3471,16 @@ static GstState validateStateWithMsTimeout( InterfacePlayerRDK *pInterfacePlayer MW_LOG_ERR("validateStateWithMsTimeout - PIPELINE gst_element_get_state - FAILURE : State = %d, Pending = %d", gst_current, gst_pending); + + if (gst_current == GST_STATE_PAUSED && gst_pending == GST_STATE_PAUSED) + + { + // Pipeline wedged in PAUSED->PAUSED transition Force state reset by going through NULL state + MW_LOG_INFO("validateStateWithMsTimeout: PAUSED->PAUSED wedged, forcing reset"); + SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_NULL); + SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_PAUSED); + } + return gst_current; } From 151da1fa522d552ff2feee0e77b6807a0eb8ba31 Mon Sep 17 00:00:00 2001 From: rkandh015 Date: Fri, 31 Jul 2026 15:10:14 +0530 Subject: [PATCH 2/3] Handle wedge pause-pause conditions --- InterfacePlayerRDK.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index a5f49f7..db7ebca 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -3453,11 +3453,11 @@ static GstState validateStateWithMsTimeout( InterfacePlayerRDK *pInterfacePlayer float timeout = 100.0; InterfacePlayerPriv* privatePlayer = pInterfacePlayerRDK->GetPrivatePlayer(); gint gstGetStateCnt = GST_ELEMENT_GET_STATE_RETRY_CNT_MAX; - + GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE; do { if ((GST_STATE_CHANGE_SUCCESS - == gst_element_get_state(privatePlayer->gstPrivateContext->pipeline, &gst_current, &gst_pending, timeout * GST_MSECOND)) + == ( ret = gst_element_get_state(privatePlayer->gstPrivateContext->pipeline, &gst_current, &gst_pending, timeout * GST_MSECOND)) ) && (gst_current == stateToValidate)) { GST_WARNING( @@ -3472,13 +3472,10 @@ static GstState validateStateWithMsTimeout( InterfacePlayerRDK *pInterfacePlayer MW_LOG_ERR("validateStateWithMsTimeout - PIPELINE gst_element_get_state - FAILURE : State = %d, Pending = %d", gst_current, gst_pending); - if (gst_current == GST_STATE_PAUSED && gst_pending == GST_STATE_PAUSED) - + if (ret == GST_STATE_CHANGE_ASYNC && gst_current == GST_STATE_PAUSED && gst_pending == GST_STATE_PAUSED) { - // Pipeline wedged in PAUSED->PAUSED transition Force state reset by going through NULL state - MW_LOG_INFO("validateStateWithMsTimeout: PAUSED->PAUSED wedged, forcing reset"); - SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_NULL); - SetStateWithWarnings(privatePlayer->gstPrivateContext->pipeline, GST_STATE_PAUSED); + MW_LOG_WARN("validateStateWithMsTimeout: PAUSED->PAUSED wedged detected, returning error to let AAMP recover"); + return GST_STATE_VOID_PENDING; } return gst_current; From b001776b8632b001f44623770f931baec130eee6 Mon Sep 17 00:00:00 2001 From: rkandh015 Date: Mon, 3 Aug 2026 15:30:51 +0530 Subject: [PATCH 3/3] =?UTF-8?q?The=20fix=20adds=20a=20second=20check=20for?= =?UTF-8?q?=20PLAYING=E2=86=92PAUSED=20timeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InterfacePlayerRDK.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index db7ebca..f783b84 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -505,6 +505,25 @@ void InterfacePlayerRDK::ConfigurePipeline(int format, int audioFormat, int subF gst_context_unref(context); } + // non-blocking state query — if pipeline is wedged in PAUSED->PAUSED, + // force NULL reset BEFORE issuing any new state transition. + // This prevents the double-wedge where ConfigurePipeline is called from a + // recovery re-seek while the pipeline is still physically stuck in PAUSED. + { + GstState cur = GST_STATE_NULL, pend = GST_STATE_NULL; + gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, + &cur, &pend, 0 /* non-blocking */); + if (cur == GST_STATE_PAUSED && pend == GST_STATE_PAUSED) + { + MW_LOG_WARN("ConfigurePipeline: pipeline wedged (PAUSED->PAUSED), " + "forcing NULL reset before state transition"); + SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, GST_STATE_NULL); + // Wait up to 200ms for NULL to complete before proceeding + gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, + &cur, &pend, 200 * GST_MSECOND); + } + } + if (interfacePlayerPriv->gstPrivateContext->pauseOnStartPlayback && GST_NORMAL_PLAY_RATE == interfacePlayerPriv->gstPrivateContext->rate) { MW_LOG_INFO("Setting state to GST_STATE_PAUSED - pause on playback enabled"); @@ -3478,6 +3497,14 @@ static GstState validateStateWithMsTimeout( InterfacePlayerRDK *pInterfacePlayer return GST_STATE_VOID_PENDING; } + if (ret == GST_STATE_CHANGE_ASYNC && gst_current == GST_STATE_PLAYING && gst_pending == GST_STATE_PAUSED) + { + MW_LOG_WARN("validateStateWithMsTimeout: PLAYING->PAUSED transition timed out " + "(State=%d, Pending=%d), returning error to let AAMP recover", + gst_current, gst_pending); + return GST_STATE_VOID_PENDING; + } + return gst_current; }