From 24f59880caf26b202bca8e39cf2eda200040fa44 Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Thu, 9 Jul 2026 15:04:56 +0530 Subject: [PATCH 1/9] Update InterfacePlayerPriv.h --- InterfacePlayerPriv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerPriv.h b/InterfacePlayerPriv.h index 296c5431..534b283a 100755 --- a/InterfacePlayerPriv.h +++ b/InterfacePlayerPriv.h @@ -41,7 +41,7 @@ #include "InterfacePlayerRDK.h" #include "GstUtils.h" -#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX 5 +#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX 10 #define GST_TRACK_COUNT 3 /**< internal use - audio+video+sub track */ #define VIDEO_COORDINATES_SIZE 32 #define GST_TASK_ID_INVALID 0 From 9510e64c0c837f62a13a87fd6fe01585d07e659b Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Thu, 9 Jul 2026 15:06:37 +0530 Subject: [PATCH 2/9] Update InterfacePlayerRDK.cpp --- InterfacePlayerRDK.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index fb3c3bfa..8a54d8fa 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -3441,12 +3441,14 @@ bool InterfacePlayerRDK::Pause(bool pause , bool forceStopGstreamerPreBuffering) /* wait a bit longer for the state change to conclude */ if (nextState != validateStateWithMsTimeout(this,nextState, 100)) { - MW_LOG_ERR("InterfacePlayerRDK_Pause - validateStateWithMsTimeout - FAILED GstState %d", nextState); + MW_LOG_ERR("InterfacePlayerRDK_Pause - validateStateWithMsTimeout - FAILED GstState %d ret-false", nextState); + retValue = false; } } else if (GST_STATE_CHANGE_SUCCESS != rc) { - MW_LOG_ERR("InterfacePlayerRDK_Pause - gst_element_set_state - FAILED rc %d", rc); + MW_LOG_ERR("InterfacePlayerRDK_Pause - gst_element_set_state - FAILED rc %d ret-false", rc); + retValue = false; } interfacePlayerPriv->gstPrivateContext->buffering_target_state = nextState; From 095f8dbac744e14cbdbcfc3f9e08851c01792054 Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Mon, 13 Jul 2026 17:34:56 +0530 Subject: [PATCH 3/9] Update InterfacePlayerRDK.cpp Handling race conditions in Flush to get the status of pause conditions --- InterfacePlayerRDK.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 8a54d8fa..c7c58888 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1581,7 +1581,7 @@ bool InterfacePlayerRDK::IsUsingRialtoSink() /** * @brief Flush cached GstBuffers and set seek position & rate */ -bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, bool isAppSeek) +bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, bool isAppSeek, bool keepPausedSeek) { GstState aud_current; GstState aud_pending; @@ -1634,6 +1634,12 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b } GstStateChangeReturn ret; ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 100 * GST_MSECOND); + if (GST_STATE_CHANGE_ASYNC == ret && keepPausedSeek) + { + MW_LOG_WARN("InterfacePlayerRDK: Flush requested during in-flight state change (current=%s pending=%s) - waiting to settle", + gst_element_state_get_name(current), gst_element_state_get_name(pending)); + ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 300 * GST_MSECOND); + } if ((current != GST_STATE_PLAYING && current != GST_STATE_PAUSED) || ret == GST_STATE_CHANGE_FAILURE) { MW_LOG_WARN("InterfacePlayerRDK: Pipeline state %s, ret %u", gst_element_state_get_name(current), ret); From fdfca90e2c6a09a61a41ab4ed449c7372f0aab4a Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Mon, 13 Jul 2026 17:43:03 +0530 Subject: [PATCH 4/9] Update InterfacePlayerRDK.h --- InterfacePlayerRDK.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.h b/InterfacePlayerRDK.h index ba5a0908..343e5f03 100644 --- a/InterfacePlayerRDK.h +++ b/InterfacePlayerRDK.h @@ -716,8 +716,9 @@ class InterfacePlayerRDK * @param[in] shouldTearDown Whether to tear down the pipeline. * @param[in] GstState The desired GStreamer pipeline state. * @param[in] gstMediaFormat The media format for the pipeline. + * @param[in] keepPausedSeek true only for an explicit seek-with-keepPaused request */ - bool Flush(double position, int rate, bool shouldTearDown, bool isAppSeek); + bool Flush(double position, int rate, bool shouldTearDown, bool isAppSeek, bool keepPausedSeek); /** * @fn TimerAdd * @param[in] funcPtr function to execute on timer expiry From c4e3f0c5d9d23736b9e4d9fe5b615438076eee5b Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Wed, 15 Jul 2026 12:41:47 +0530 Subject: [PATCH 5/9] Update InterfacePlayerRDK.cpp --- InterfacePlayerRDK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index c7c58888..9da2784e 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1638,7 +1638,7 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b { MW_LOG_WARN("InterfacePlayerRDK: Flush requested during in-flight state change (current=%s pending=%s) - waiting to settle", gst_element_state_get_name(current), gst_element_state_get_name(pending)); - ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 300 * GST_MSECOND); + ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 500 * GST_MSECOND); } if ((current != GST_STATE_PLAYING && current != GST_STATE_PAUSED) || ret == GST_STATE_CHANGE_FAILURE) { From 43f83aa0925ab7ba09b6f29100e265a11180e302 Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Sun, 19 Jul 2026 23:27:58 +0530 Subject: [PATCH 6/9] Update InterfacePlayerRDK.cpp --- InterfacePlayerRDK.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 9da2784e..c7c58888 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1638,7 +1638,7 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b { MW_LOG_WARN("InterfacePlayerRDK: Flush requested during in-flight state change (current=%s pending=%s) - waiting to settle", gst_element_state_get_name(current), gst_element_state_get_name(pending)); - ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 500 * GST_MSECOND); + ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 300 * GST_MSECOND); } if ((current != GST_STATE_PLAYING && current != GST_STATE_PAUSED) || ret == GST_STATE_CHANGE_FAILURE) { From e2ee18fd245063088880b22340055d8aebe5dd98 Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Sun, 19 Jul 2026 23:48:08 +0530 Subject: [PATCH 7/9] Update InterfacePlayerRDK.cpp --- InterfacePlayerRDK.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index c7c58888..5576162b 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1634,12 +1634,7 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b } GstStateChangeReturn ret; ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 100 * GST_MSECOND); - if (GST_STATE_CHANGE_ASYNC == ret && keepPausedSeek) - { - MW_LOG_WARN("InterfacePlayerRDK: Flush requested during in-flight state change (current=%s pending=%s) - waiting to settle", - gst_element_state_get_name(current), gst_element_state_get_name(pending)); - ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 300 * GST_MSECOND); - } + if ((current != GST_STATE_PLAYING && current != GST_STATE_PAUSED) || ret == GST_STATE_CHANGE_FAILURE) { MW_LOG_WARN("InterfacePlayerRDK: Pipeline state %s, ret %u", gst_element_state_get_name(current), ret); @@ -3438,6 +3433,22 @@ bool InterfacePlayerRDK::Pause(bool pause , bool forceStopGstreamerPreBuffering) */ interfacePlayerPriv->gstPrivateContext->buffering_in_progress = false; } + + if (GST_STATE_PLAYING == nextState) + { + GstState curState, pendState; + if (GST_STATE_CHANGE_ASYNC == + gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, + &curState, &pendState, 0)) + { + MW_LOG_WARN("InterfacePlayerRDK_Pause: resume during in-flight transition " + "(current=%s pending=%s) - settling before PLAYING", + gst_element_state_get_name(curState), + gst_element_state_get_name(pendState)); + gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, + &curState, &pendState, 300 * GST_MSECOND); + } + } GstStateChangeReturn rc = SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, nextState); if (GST_STATE_CHANGE_ASYNC == rc) From 298046b39679759fa5bafcd5e6bbebdfdb37d36d Mon Sep 17 00:00:00 2001 From: rekhap2kandhavelan Date: Tue, 21 Jul 2026 11:28:50 +0530 Subject: [PATCH 8/9] Update InterfacePlayerPriv.h --- InterfacePlayerPriv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InterfacePlayerPriv.h b/InterfacePlayerPriv.h index 534b283a..296c5431 100755 --- a/InterfacePlayerPriv.h +++ b/InterfacePlayerPriv.h @@ -41,7 +41,7 @@ #include "InterfacePlayerRDK.h" #include "GstUtils.h" -#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX 10 +#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX 5 #define GST_TRACK_COUNT 3 /**< internal use - audio+video+sub track */ #define VIDEO_COORDINATES_SIZE 32 #define GST_TASK_ID_INVALID 0 From efe07841775e510c669fc77da42a3d0101e3e7aa Mon Sep 17 00:00:00 2001 From: rkandh015 Date: Tue, 21 Jul 2026 11:51:48 +0530 Subject: [PATCH 9/9] Revert "Update InterfacePlayerRDK.cpp" This reverts commit e2ee18fd245063088880b22340055d8aebe5dd98. --- InterfacePlayerRDK.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/InterfacePlayerRDK.cpp b/InterfacePlayerRDK.cpp index 5576162b..c7c58888 100644 --- a/InterfacePlayerRDK.cpp +++ b/InterfacePlayerRDK.cpp @@ -1634,7 +1634,12 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b } GstStateChangeReturn ret; ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 100 * GST_MSECOND); - + if (GST_STATE_CHANGE_ASYNC == ret && keepPausedSeek) + { + MW_LOG_WARN("InterfacePlayerRDK: Flush requested during in-flight state change (current=%s pending=%s) - waiting to settle", + gst_element_state_get_name(current), gst_element_state_get_name(pending)); + ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, ¤t, &pending, 300 * GST_MSECOND); + } if ((current != GST_STATE_PLAYING && current != GST_STATE_PAUSED) || ret == GST_STATE_CHANGE_FAILURE) { MW_LOG_WARN("InterfacePlayerRDK: Pipeline state %s, ret %u", gst_element_state_get_name(current), ret); @@ -3433,22 +3438,6 @@ bool InterfacePlayerRDK::Pause(bool pause , bool forceStopGstreamerPreBuffering) */ interfacePlayerPriv->gstPrivateContext->buffering_in_progress = false; } - - if (GST_STATE_PLAYING == nextState) - { - GstState curState, pendState; - if (GST_STATE_CHANGE_ASYNC == - gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, - &curState, &pendState, 0)) - { - MW_LOG_WARN("InterfacePlayerRDK_Pause: resume during in-flight transition " - "(current=%s pending=%s) - settling before PLAYING", - gst_element_state_get_name(curState), - gst_element_state_get_name(pendState)); - gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, - &curState, &pendState, 300 * GST_MSECOND); - } - } GstStateChangeReturn rc = SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, nextState); if (GST_STATE_CHANGE_ASYNC == rc)