RDKTV-23013: Hisense v2 SetPlayback rate failing to play at 2X speed

Reason for change: disable instant rate change in cobalt.
Test Procedure: refer ticket.
Risks: None
Priority: P1
Signed-off-by: sramul630 <sunil_ramulu@comcast.com>

Change-Id: Icae7b8014600d2791f4cc01f7e306f48014723b9
diff --git a/src/third_party/starboard/rdk/shared/player/player_internal.cc b/src/third_party/starboard/rdk/shared/player/player_internal.cc
index d5ce9a6..d3b9b5f 100644
--- a/src/third_party/starboard/rdk/shared/player/player_internal.cc
+++ b/src/third_party/starboard/rdk/shared/player/player_internal.cc
@@ -470,7 +470,8 @@
       return GST_PAD_PROBE_OK;
     }, msg, [](gpointer data) { gst_message_unref(GST_MESSAGE(data)); });
 
-#if GST_CHECK_VERSION(1,18,0)
+//#if GST_CHECK_VERSION(1,18,0)
+#if 0
   gst_pad_add_probe (
     pad, GST_PAD_PROBE_TYPE_EVENT_BOTH,
     [](GstPad * pad, GstPadProbeInfo * info, gpointer data) -> GstPadProbeReturn {
@@ -2383,7 +2384,22 @@
     need_instant_rate_change_ = ( rate != 1. );
     mutex_.Release();
 
-#if GST_CHECK_VERSION(1,18,0)
+    // TODO: remove special handling of amlhalasink
+    GstElement* sink = nullptr;
+    g_object_get(pipeline_, "audio-sink", &sink, nullptr);
+    if (sink && g_str_has_prefix(GST_ELEMENT_NAME(sink), "amlhalasink")) {
+      GstSegment* segment = gst_segment_new();
+      gst_segment_init(segment, GST_FORMAT_TIME);
+      segment->rate = rate;
+      segment->start = GST_CLOCK_TIME_NONE;
+      segment->position = GST_CLOCK_TIME_NONE;
+      GST_DEBUG_OBJECT(pipeline_, "===> Sending new segment %" GST_SEGMENT_FORMAT, segment);
+      success = gst_pad_send_event (GST_BASE_SINK_PAD(sink), gst_event_new_segment(segment));
+      GST_DEBUG_OBJECT(pipeline_, "===> Sent new segment, success = %s", success ? "true" : "false");
+      gst_segment_free(segment);
+    }
+//#if GST_CHECK_VERSION(1,18,0)
+#if 0
     static const bool kEnableInstantRateChangeSeek = ([]()->bool {
       if( !!getenv("COBALT_DISABLE_INSTANT_RATE_CHANGE_SEEK") )
         return false;
@@ -2405,6 +2421,7 @@
     }
     else
 #endif
+    else
     {
       GstStructure* s = gst_structure_new(
         kCustomInstantRateChangeEventName, "rate", G_TYPE_DOUBLE, rate, NULL);
@@ -2412,6 +2429,9 @@
         pipeline_, gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM_OOB, s));
     }
 
+    if (sink)
+       g_object_unref(sink);
+
     mutex_.Acquire();
   }