summaryrefslogtreecommitdiffstats
path: root/binding/afm-mediaplayer-binding.c
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 15:15:24 +0000
commit7120a21d0880df6aa9f1c3cb7f7224699a6fe033 (patch)
tree20527cd8a24059756ec5a4854896073c1bd714e3 /binding/afm-mediaplayer-binding.c
parent26c1a6bd4217e479695453b0142631244491eaff (diff)
Some fixes for corked state trackingicefish_8.99.4icefish/8.99.48.99.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
Diffstat (limited to 'binding/afm-mediaplayer-binding.c')
-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);