summaryrefslogtreecommitdiff
path: root/src
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
commit93698ce0fb7e0048cff4947f7ee9f2c289f3c7cc (patch)
tree05d8e99f852fa0dbcd0beefd8a0c88da08863a70 /src
parentf6a31b390b709f72d13440796468a6ad3ca006b5 (diff)
downloademotion_generic_players-93698ce0fb7e0048cff4947f7ee9f2c289f3c7cc.tar.gz
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 'src')
-rw-r--r--src/vlc/emotion_generic_vlc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/vlc/emotion_generic_vlc.c b/src/vlc/emotion_generic_vlc.c
index 836eda3..d153416 100644
--- a/src/vlc/emotion_generic_vlc.c
+++ b/src/vlc/emotion_generic_vlc.c
@@ -37,6 +37,7 @@ struct _App {
libvlc_event_manager_t *event_mgr;
libvlc_event_manager_t *mevent_mgr;
char *filename;
+ char *subtitle_path;
char *shmname;
void *tmpbuffer;
int w, h;
@@ -313,6 +314,10 @@ _play(struct _App *app)
libvlc_time_t new_time = pos * 1000;
libvlc_media_player_set_time(app->mp, new_time);
libvlc_media_player_play(app->mp);
+
+ if (app->subtitle_path)
+ libvlc_video_set_subtitle_file(app->mp, app->subtitle_path);
+
app->playing = 1;
}
}
@@ -378,6 +383,12 @@ _event_cb(const struct libvlc_event_t *ev, void *data)
}
static void
+_subtitle_set(struct _App *app)
+{
+ _em_str_read(app->em_read, &app->subtitle_path);
+}
+
+static void
_file_set(struct _App *app)
{
if (app->opening)
@@ -585,6 +596,9 @@ _process_emotion_commands(struct _App *app)
case EM_CMD_FILE_SET_DONE:
_file_set_done(app);
break;
+ case EM_CMD_SUBTITLE_SET:
+ _subtitle_set(app);
+ break;
case EM_CMD_FILE_CLOSE:
_file_close(app);
break;
@@ -805,6 +819,7 @@ main(int argc, const char *argv[])
app.libvlc = libvlc_new(vlc_argc, vlc_argv);
app.mp = NULL;
app.filename = NULL;
+ app.subtitle_path = NULL;
app.w = 0;
app.h = 0;
app.size_sent = 0;