summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
diff options
context:
space:
mode:
authorLeandro Dorileo <dorileo@profusion.mobi>2013-01-02 21:03:30 +0000
committerLeandro Dorileo <dorileo@profusion.mobi>2013-01-02 21:03:30 +0000
commite3e1511bacd6f7b528f860408a18dc4fb76f3070 (patch)
treee3cf55bd13fb4c8ad8187d074baa0ad77b4fcdd2 /legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
parent37bcda87ed63e79a8a3b39431cfe9bf9233e12ce (diff)
Emotion: introce emotion_object_video_subtitle_file_set() call
For setting an arbitrary subtitle file, this patch introduces the emotion_object_video_subtitle_file_set() and its counterpart emotion_object_video_subtitle_file_get(). The tag @sice were added as 1.7.2 since we're preparing a backport to stable tree. SVN revision: 82019
Diffstat (limited to '')
-rw-r--r--legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
index 836eda3a45..d15341667a 100644
--- a/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
+++ b/legacy/emotion/src/generic_players/vlc/emotion_generic_vlc.c
@@ -37,6 +37,7 @@ struct _App {
37 libvlc_event_manager_t *event_mgr; 37 libvlc_event_manager_t *event_mgr;
38 libvlc_event_manager_t *mevent_mgr; 38 libvlc_event_manager_t *mevent_mgr;
39 char *filename; 39 char *filename;
40 char *subtitle_path;
40 char *shmname; 41 char *shmname;
41 void *tmpbuffer; 42 void *tmpbuffer;
42 int w, h; 43 int w, h;
@@ -313,6 +314,10 @@ _play(struct _App *app)
313 libvlc_time_t new_time = pos * 1000; 314 libvlc_time_t new_time = pos * 1000;
314 libvlc_media_player_set_time(app->mp, new_time); 315 libvlc_media_player_set_time(app->mp, new_time);
315 libvlc_media_player_play(app->mp); 316 libvlc_media_player_play(app->mp);
317
318 if (app->subtitle_path)
319 libvlc_video_set_subtitle_file(app->mp, app->subtitle_path);
320
316 app->playing = 1; 321 app->playing = 1;
317 } 322 }
318} 323}
@@ -378,6 +383,12 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
378} 383}
379 384
380static void 385static void
386_subtitle_set(struct _App *app)
387{
388 _em_str_read(app->em_read, &app->subtitle_path);
389}
390
391static void
381_file_set(struct _App *app) 392_file_set(struct _App *app)
382{ 393{
383 if (app->opening) 394 if (app->opening)
@@ -585,6 +596,9 @@ _process_emotion_commands(struct _App *app)
585 case EM_CMD_FILE_SET_DONE: 596 case EM_CMD_FILE_SET_DONE:
586 _file_set_done(app); 597 _file_set_done(app);
587 break; 598 break;
599 case EM_CMD_SUBTITLE_SET:
600 _subtitle_set(app);
601 break;
588 case EM_CMD_FILE_CLOSE: 602 case EM_CMD_FILE_CLOSE:
589 _file_close(app); 603 _file_close(app);
590 break; 604 break;
@@ -805,6 +819,7 @@ main(int argc, const char *argv[])
805 app.libvlc = libvlc_new(vlc_argc, vlc_argv); 819 app.libvlc = libvlc_new(vlc_argc, vlc_argv);
806 app.mp = NULL; 820 app.mp = NULL;
807 app.filename = NULL; 821 app.filename = NULL;
822 app.subtitle_path = NULL;
808 app.w = 0; 823 app.w = 0;
809 app.h = 0; 824 app.h = 0;
810 app.size_sent = 0; 825 app.size_sent = 0;