summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2016-07-23 23:31:35 +0200
committerDave Andreoli <dave@gurumeditation.it>2016-07-24 11:07:23 +0200
commit3a726037fa8e9b2042a514f1441719a5ae883807 (patch)
tree5e321ac4866465b39a77ed754505dffd7f721e73
parent556082d2e2a6a466c92482f77e41ee29fa9fac9d (diff)
Gstreamer1: implement subtitles mute/unmute ability
This seems the only way to disable subtitles embedded in the video file. WIthout this patch calling em_spu_mute_set/get do not work, thus I consider this a @fix
-rw-r--r--src/modules/emotion/gstreamer1/emotion_gstreamer.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.c b/src/modules/emotion/gstreamer1/emotion_gstreamer.c
index b6574a5139..3a76595e92 100644
--- a/src/modules/emotion/gstreamer1/emotion_gstreamer.c
+++ b/src/modules/emotion/gstreamer1/emotion_gstreamer.c
@@ -895,7 +895,7 @@ em_spu_channel_set(void *video, int channel)
895 895
896 if (channel < 0) channel = -1; 896 if (channel < 0) channel = -1;
897 897
898 g_object_set (ev->pipeline, "current-text", channel, NULL); 898 g_object_set(ev->pipeline, "current-text", channel, NULL);
899} 899}
900 900
901static int 901static int
@@ -918,14 +918,34 @@ em_spu_channel_name_get(void *video EINA_UNUSED, int channel EINA_UNUSED)
918} 918}
919 919
920static void 920static void
921em_spu_channel_mute_set(void *video EINA_UNUSED, int mute EINA_UNUSED) 921em_spu_channel_mute_set(void *video, int mute)
922{ 922{
923 Emotion_Gstreamer *ev = video;
924 gint flags;
925
926 if (!ev->pipeline) return;
927
928 g_object_get(ev->pipeline, "flags", &flags, NULL);
929
930 if (mute)
931 flags &= ~GST_PLAY_FLAG_TEXT;
932 else
933 flags |= GST_PLAY_FLAG_TEXT;
934
935 g_object_set(ev->pipeline, "flags", flags, NULL);
923} 936}
924 937
925static int 938static int
926em_spu_channel_mute_get(void *video EINA_UNUSED) 939em_spu_channel_mute_get(void *video)
927{ 940{
928 return 0; 941 Emotion_Gstreamer *ev = video;
942 gint flags;
943
944 if (!ev->pipeline) return 0;
945
946 g_object_get(ev->pipeline, "flags", &flags, NULL);
947
948 return (flags & GST_PLAY_FLAG_TEXT) ? 0 : 1;
929} 949}
930 950
931static int 951static int