From d35a6986f5729b795e510fa30035b9e6fec74eb1 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Wed, 4 Mar 2020 13:41:29 -0800 Subject: 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 --- binding/afm-mediaplayer-binding.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'binding') 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) { -- cgit 1.2.3-korg