summaryrefslogtreecommitdiff
path: root/src/plugins/vlc_extractor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/vlc_extractor.c')
-rw-r--r--src/plugins/vlc_extractor.c61
1 files changed, 54 insertions, 7 deletions
diff --git a/src/plugins/vlc_extractor.c b/src/plugins/vlc_extractor.c
index e90b3ea..ab9dfb2 100644
--- a/src/plugins/vlc_extractor.c
+++ b/src/plugins/vlc_extractor.c
@@ -266,6 +266,20 @@ media_ready (const struct libvlc_event_t *p_event,
}
+static void
+my_logger (void *data,
+ int level,
+ const libvlc_log_t *ctx,
+ const char *fmt,
+ va_list args)
+{
+ vfprintf (stderr,
+ fmt,
+ args);
+ fprintf (stderr, "\n");
+}
+
+
/**
* Extract information using libvlc
*
@@ -287,15 +301,48 @@ EXTRACTOR_vlc_extract_method (struct EXTRACTOR_ExtractContext *ec)
pthread_sigmask (SIG_BLOCK, &set, NULL);
}
- vlc = libvlc_new (0, NULL);
+ {
+ const char *argv[] = {
+ "-v",
+ "3",
+ NULL
+ };
+ vlc = libvlc_new (2, argv);
+ }
if (NULL == vlc)
return;
- media = libvlc_media_new_callbacks (vlc,
- &open_cb,
- &read_cb,
- &seek_cb,
- &close_cb,
- ec);
+ libvlc_log_set (vlc,
+ &my_logger,
+ NULL);
+ if (0)
+ {
+ fprintf (stderr,
+ "Opening file `%s'\n",
+ "testdata/matroska_flame.mkv");
+ int fd = open ("testdata/matroska_flame.mkv",
+ O_RDONLY);
+ if (-1 == fd)
+ {
+ fprintf (stderr,
+ "Open failed: %s\n",
+ strerror (errno));
+ libvlc_release (vlc);
+ return;
+ }
+ media = libvlc_media_new_fd (vlc,
+ fd);
+ }
+ else
+ {
+ fprintf (stderr,
+ "Reading via IPC\n");
+ media = libvlc_media_new_callbacks (vlc,
+ &open_cb,
+ &read_cb,
+ &seek_cb,
+ &close_cb,
+ ec);
+ }
if (NULL == media)
{
libvlc_release (vlc);