[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libextractor] branch master updated: update vlc code for testing
From: |
gnunet |
Subject: |
[libextractor] branch master updated: update vlc code for testing |
Date: |
Thu, 06 May 2021 07:09:51 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libextractor.
The following commit(s) were added to refs/heads/master by this push:
new 9f6480d update vlc code for testing
9f6480d is described below
commit 9f6480dc09acfefe02dbb438ace34573fa056af9
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Thu May 6 07:07:35 2021 +0200
update vlc code for testing
---
src/plugins/vlc_extractor.c | 61 +++++++++++++++++++++++++++++++++++++++------
1 file 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);
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libextractor] branch master updated: update vlc code for testing,
gnunet <=