raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2ce7feb3d5e1a0ee1a517aa87a10060924e014ff
commit 2ce7feb3d5e1a0ee1a517aa87a10060924e014ff Author: Carsten Haitzler <[email protected]> Date: Sun Sep 26 21:23:24 2021 +0100 emotion - properly track subtitle mute state and init emotion obj early fix setting things on an emotion obj early bu initting engine early and also track spu mute flags to set on pipe later @fix --- src/lib/emotion/emotion_smart.c | 7 ++++++- src/modules/emotion/gstreamer1/emotion_gstreamer.c | 18 +++++++++--------- src/modules/emotion/gstreamer1/emotion_gstreamer.h | 1 + 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index e8c22e912c..3dc5dd4270 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c @@ -242,12 +242,17 @@ emotion_object_add(Evas *evas) } EOLIAN static Eo * -_efl_canvas_video_efl_object_constructor(Eo *obj, Efl_Canvas_Video_Data *pd EINA_UNUSED) +_efl_canvas_video_efl_object_constructor(Eo *obj, Efl_Canvas_Video_Data *pd) { efl_canvas_group_clipped_set(obj, EINA_TRUE); obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, E_OBJ_NAME); + eina_stringshare_replace(&(pd->engine), "gstreamer1"); + pd->spu.button = -1; + pd->ratio = 1.0; + _engine_init(obj, pd); + return obj; } diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.c b/src/modules/emotion/gstreamer1/emotion_gstreamer.c index 2def4d70d3..b96478d02e 100644 --- a/src/modules/emotion/gstreamer1/emotion_gstreamer.c +++ b/src/modules/emotion/gstreamer1/emotion_gstreamer.c @@ -922,15 +922,13 @@ em_spu_channel_mute_set(void *video, int mute) Emotion_Gstreamer *ev = video; gint flags; + ev->spu_mute = !!mute; + if (!ev->pipeline) return; g_object_get(ev->pipeline, "flags", &flags, NULL); - - if (mute) - flags &= ~GST_PLAY_FLAG_TEXT; - else - flags |= GST_PLAY_FLAG_TEXT; - + if (ev->spu_mute) flags &= ~GST_PLAY_FLAG_TEXT; + else flags |= GST_PLAY_FLAG_TEXT; g_object_set(ev->pipeline, "flags", flags, NULL); } @@ -1113,10 +1111,11 @@ em_add(const Emotion_Engine *api, /* Default values */ ev->vis = EMOTION_VIS_NONE; - ev->volume = 0.8; + ev->volume = 1.0; ev->ready = EINA_FALSE; ev->shutdown = EINA_FALSE; ev->threads = NULL; + ev->spu_mute = EINA_TRUE; return ev; } @@ -1772,8 +1771,9 @@ _create_pipeline(Emotion_Gstreamer *ev, g_object_set(G_OBJECT(vsink), "emotion-object", o, NULL); g_object_get(G_OBJECT(playbin), "flags", &flags, NULL); - g_object_set(G_OBJECT(playbin), "flags", - (flags | GST_PLAY_FLAG_DOWNLOAD) & ~GST_PLAY_FLAG_TEXT, NULL); + if (ev->spu_mute) flags &= ~GST_PLAY_FLAG_TEXT; + else flags |= GST_PLAY_FLAG_TEXT; + g_object_set(G_OBJECT(playbin), "flags", (flags | GST_PLAY_FLAG_DOWNLOAD), NULL); g_object_set(G_OBJECT(playbin), "video-sink", vsink, NULL); g_object_set(G_OBJECT(playbin), "uri", uri, NULL); if (suburi) diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.h b/src/modules/emotion/gstreamer1/emotion_gstreamer.h index 2469ef28d4..fd5e24fde7 100644 --- a/src/modules/emotion/gstreamer1/emotion_gstreamer.h +++ b/src/modules/emotion/gstreamer1/emotion_gstreamer.h @@ -87,6 +87,7 @@ struct _Emotion_Gstreamer Eina_Bool play : 1; Eina_Bool video_mute : 1; Eina_Bool audio_mute : 1; + Eina_Bool spu_mute : 1; Eina_Bool ready : 1; Eina_Bool live : 1; Eina_Bool buffering : 1; --
