aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--binding/afm-common.c1
-rw-r--r--binding/afm-common.h1
-rw-r--r--binding/afm-mediaplayer-binding.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/binding/afm-common.c b/binding/afm-common.c
index 0f27d57..ec68b8d 100644
--- a/binding/afm-common.c
+++ b/binding/afm-common.c
@@ -30,6 +30,7 @@ const char *control_commands[] = {
"pick-track",
"volume",
"loop",
+ "stop",
};
int get_command_index(const char *name)
diff --git a/binding/afm-common.h b/binding/afm-common.h
index 5b36404..302dd26 100644
--- a/binding/afm-common.h
+++ b/binding/afm-common.h
@@ -48,6 +48,7 @@ enum {
PICKTRACK_CMD,
VOLUME_CMD,
LOOP_CMD,
+ STOP_CMD,
NUM_CMDS
};
diff --git a/binding/afm-mediaplayer-binding.c b/binding/afm-mediaplayer-binding.c
index 805a6bb..e95b4ba 100644
--- a/binding/afm-mediaplayer-binding.c
+++ b/binding/afm-mediaplayer-binding.c
@@ -387,6 +387,9 @@ static void controls(struct afb_req request)
data.loop = !strcasecmp(state, "true") ? TRUE : FALSE;
break;
}
+ case STOP_CMD:
+ gst_element_set_state(data.playbin, GST_STATE_NULL);
+ break;
default:
afb_req_fail(request, "failed", "unknown command");
pthread_mutex_unlock(&mutex);