summaryrefslogtreecommitdiff
path: root/src/modules/emotion/libvlc
diff options
context:
space:
mode:
authorThomas Guillem <thomas@gllm.fr>2016-03-25 09:05:34 +0100
committerJean-Philippe Andre <jp.andre@samsung.com>2016-03-28 16:40:02 +0900
commit941ccc43247fe23aba125180e9787c851a79b4d3 (patch)
tree99fe2865e75c1fbfbd482c42499477e11cff3a65 /src/modules/emotion/libvlc
parentf04903119c27355b80dc52445fe329eac2a98c40 (diff)
emotion/libvlc: fix video/audio/spu mute
Diffstat (limited to 'src/modules/emotion/libvlc')
-rw-r--r--src/modules/emotion/libvlc/emotion_libvlc.c49
1 files changed, 27 insertions, 22 deletions
diff --git a/src/modules/emotion/libvlc/emotion_libvlc.c b/src/modules/emotion/libvlc/emotion_libvlc.c
index b1a930efff..4f4ffb31b9 100644
--- a/src/modules/emotion/libvlc/emotion_libvlc.c
+++ b/src/modules/emotion/libvlc/emotion_libvlc.c
@@ -69,6 +69,7 @@ struct _Emotion_LibVLC
69 /* options */ 69 /* options */
70 int video_mute; 70 int video_mute;
71 int audio_mute; 71 int audio_mute;
72 int spu_mute;
72 int audio_vol; 73 int audio_vol;
73 Emotion_Vis vis; 74 Emotion_Vis vis;
74 75
@@ -701,7 +702,6 @@ em_add(const Emotion_Engine *api EINA_UNUSED,
701 eina_lock_new(&ev->lock); 702 eina_lock_new(&ev->lock);
702 eina_condition_new(&ev->wait, &ev->lock); 703 eina_condition_new(&ev->wait, &ev->lock);
703 ev->ref_count = 1; 704 ev->ref_count = 1;
704 ev->audio_mute = -1;
705 ev->audio_vol = -1; 705 ev->audio_vol = -1;
706 706
707 return ev; 707 return ev;
@@ -752,12 +752,15 @@ em_file_open(void *video,
752 ev->m = libvlc_media_new_path(libvlc, file); 752 ev->m = libvlc_media_new_path(libvlc, file);
753 EINA_SAFETY_ON_NULL_GOTO(ev->m, error); 753 EINA_SAFETY_ON_NULL_GOTO(ev->m, error);
754 754
755 if (ev->opt.no_audio) 755 if (ev->opt.no_audio || ev->audio_mute)
756 libvlc_media_add_option(ev->m, ":no-audio"); 756 libvlc_media_add_option(ev->m, ":no-audio");
757 757
758 if (ev->opt.no_video) 758 if (ev->opt.no_video || ev->video_mute)
759 libvlc_media_add_option(ev->m, ":no-video"); 759 libvlc_media_add_option(ev->m, ":no-video");
760 760
761 if (ev->spu_mute)
762 libvlc_media_add_option(ev->m, ":no-spu");
763
761 /* Create libvlc_media_player */ 764 /* Create libvlc_media_player */
762 ev->mp = libvlc_media_player_new_from_media(ev->m); 765 ev->mp = libvlc_media_player_new_from_media(ev->m);
763 EINA_SAFETY_ON_NULL_GOTO(ev->mp, error); 766 EINA_SAFETY_ON_NULL_GOTO(ev->mp, error);
@@ -770,16 +773,11 @@ em_file_open(void *video,
770 libvlc_position_disable, 0); 773 libvlc_position_disable, 0);
771 774
772 /* Set sink callbacks */ 775 /* Set sink callbacks */
773 if (!ev->opt.no_video) 776 libvlc_video_set_format_callbacks(ev->mp, libvlc_video_on_format, NULL);
774 { 777 libvlc_video_set_callbacks(ev->mp, libvlc_video_on_lock,
775 libvlc_video_set_format_callbacks(ev->mp, libvlc_video_on_format, NULL); 778 libvlc_video_on_unlock,
776 libvlc_video_set_callbacks(ev->mp, libvlc_video_on_lock, 779 libvlc_video_on_display, ev);
777 libvlc_video_on_unlock,
778 libvlc_video_on_display, ev);
779 }
780 780
781 if (ev->audio_mute != -1)
782 libvlc_audio_set_mute(ev->mp, 1);
783 if (ev->audio_vol != -1) 781 if (ev->audio_vol != -1)
784 libvlc_audio_set_volume(ev->mp, ev->audio_vol); 782 libvlc_audio_set_volume(ev->mp, ev->audio_vol);
785 783
@@ -1268,6 +1266,9 @@ em_video_channel_mute_set(void *video,
1268 Emotion_LibVLC *ev = video; 1266 Emotion_LibVLC *ev = video;
1269 1267
1270 ev->video_mute = mute; 1268 ev->video_mute = mute;
1269
1270 if (libvlc_mp_is_ready(ev))
1271 em_video_channel_set(video, mute ? -1 : 0);
1271} 1272}
1272 1273
1273static int 1274static int
@@ -1351,9 +1352,8 @@ em_audio_channel_mute_set(void *video,
1351 1352
1352 ev->audio_mute = mute; 1353 ev->audio_mute = mute;
1353 1354
1354 if (!libvlc_mp_is_ready(ev)) return; 1355 if (libvlc_mp_is_ready(ev))
1355 1356 em_audio_channel_set(video, mute ? -1 : 0);
1356 libvlc_audio_set_mute(ev->mp, mute);
1357} 1357}
1358 1358
1359static int 1359static int
@@ -1361,10 +1361,7 @@ em_audio_channel_mute_get(void *video)
1361{ 1361{
1362 Emotion_LibVLC *ev = video; 1362 Emotion_LibVLC *ev = video;
1363 1363
1364 if (!libvlc_mp_is_ready(ev)) 1364 return ev->audio_mute;
1365 return ev->audio_mute;
1366
1367 return libvlc_audio_get_mute(ev->mp);
1368} 1365}
1369 1366
1370static void 1367static void
@@ -1454,14 +1451,22 @@ em_spu_channel_name_get(void *video,
1454} 1451}
1455 1452
1456static void 1453static void
1457em_spu_channel_mute_set(void *video EINA_UNUSED, int mute EINA_UNUSED) 1454em_spu_channel_mute_set(void *video, int mute)
1458{ 1455{
1456 Emotion_LibVLC *ev = video;
1457
1458 ev->spu_mute = mute;
1459
1460 if (libvlc_mp_is_ready(ev))
1461 em_spu_channel_set(video, mute ? -1 : 0);
1459} 1462}
1460 1463
1461static int 1464static int
1462em_spu_channel_mute_get(void *video EINA_UNUSED) 1465em_spu_channel_mute_get(void *video)
1463{ 1466{
1464 return 0; 1467 Emotion_LibVLC *ev = video;
1468
1469 return ev->spu_mute;
1465} 1470}
1466 1471
1467static int 1472static int