summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-12-19 10:05:23 -0500
committerScott Murray <scott.murray@konsulko.com>2019-12-19 10:16:15 -0500
commit760bc2d8b646ec3b30a9021ce9de35c4bce59d5e (patch)
treecaf8541f62b84cdedd45a2a1374d992f94fc8347
parent3c0329781bd24849dc054516762c8ad1e27927e0 (diff)
Some fixes for corked state trackinghalibut_8.0.4halibut/8.0.48.0.4
Fixes: - Clear the corked state flag on stop and track changes to keep it in sync. - Add changing of pipeline state in response to the GstBus GST_MESSAGE_REQUEST_STATE message, this is required to have the second request to switch back to PLAYING state be sent, and hence properly keeping track of corked state. Bug-AGL: SPEC-3061, SPEC-3047 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I7a7727e1671b82aaafe816d30481bef720f19037
-rw-r--r--binding/afm-mediaplayer-binding.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 36b2ad0..b0ee725 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -235,6 +235,8 @@ static int set_media_uri(struct playlist_item *item, int state)
AFB_DEBUG("GSTREAMER playbin.state = GST_STATE_PAUSED");
#endif
}
+ // We can't be corked at this point
+ data.corked = FALSE;
double vol = (double) data.volume / 100.0;
g_object_set(data.playbin, "volume", vol, NULL);
@@ -481,6 +483,7 @@ static void gstreamer_controls(afb_req_t request)
AFB_DEBUG("GSTREAMER playbin.state = GST_STATE_PAUSED");
#endif
data.playing = FALSE;
+ data.corked = FALSE;
/* metadata event */
jresp = populate_json_metadata();
@@ -838,8 +841,13 @@ static gboolean handle_message(GstBus *bus, GstMessage *msg, CustomData *data)
if (state == GST_STATE_PAUSED) {
data->corked = TRUE;
+ // NOTE: Explicitly using PAUSED here, this case currently
+ // is separate from the general PAUSED/READY issue wrt
+ // Wireplumber policy.
+ gst_element_set_state(data->playbin, GST_STATE_PAUSED);
} else if (state == GST_STATE_PLAYING) {
data->corked = FALSE;
+ gst_element_set_state(data->playbin, GST_STATE_PLAYING);
}
g_mutex_unlock(&mutex);