summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2020-03-04 13:41:29 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2020-03-04 13:47:45 -0800
commit4985c0211a2476d8cd48590f61acb88d7da63834 (patch)
tree97f5e0b29baba1fef6cf00136969fc4954e45bf1
parentcf3e93f89e32747ac7739327abdb64f2374475cc (diff)
mediaplayer: don't execute PLAY_CMD if already playing
Using Mediaplayer UI it is possible to send multiple play events before the Pause button is displayed. This seems to cause unexpected side effects on playback. Bug-AGL: SPEC-3197 Change-Id: Iad6b0998e8bcc1331cb78d8f45081d0e6185913a Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--binding/afm-mediaplayer-binding.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 2a66afb..5f66196 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -453,6 +453,12 @@ static void gstreamer_controls(afb_req_t request)
switch (cmd) {
case PLAY_CMD: {
GstElement *obj = NULL;
+
+ if (data.playing) {
+ afb_req_fail(request, "failed", "Already playing");
+ return;
+ }
+
g_object_get(data.playbin, "audio-sink", &obj, NULL);
if (obj == data.fake_sink) {