diff options
Diffstat (limited to 'src/plugins/test-vlc.c')
-rw-r--r-- | src/plugins/test-vlc.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/plugins/test-vlc.c b/src/plugins/test-vlc.c index 6bef893..3dbe6a4 100644 --- a/src/plugins/test-vlc.c +++ b/src/plugins/test-vlc.c | |||
@@ -132,8 +132,8 @@ my_logger (void *data, | |||
132 | * @param ec extraction context | 132 | * @param ec extraction context |
133 | */ | 133 | */ |
134 | void | 134 | void |
135 | main(int argc, | 135 | main (int argc, |
136 | char **argv) | 136 | char **argv) |
137 | { | 137 | { |
138 | libvlc_instance_t *vlc; | 138 | libvlc_instance_t *vlc; |
139 | libvlc_media_t *media; | 139 | libvlc_media_t *media; |
@@ -161,8 +161,27 @@ main(int argc, | |||
161 | libvlc_log_set (vlc, | 161 | libvlc_log_set (vlc, |
162 | &my_logger, | 162 | &my_logger, |
163 | NULL); | 163 | NULL); |
164 | media = libvlc_media_new_path (vlc, | 164 | if (0) |
165 | argv[1]); | 165 | { |
166 | media = libvlc_media_new_path (vlc, | ||
167 | argv[1]); | ||
168 | } | ||
169 | else | ||
170 | { | ||
171 | int fd = open (argv[1], | ||
172 | O_RDONLY); | ||
173 | if (-1 == fd) | ||
174 | { | ||
175 | fprintf (stderr, | ||
176 | "Open %s failed: %s\n", | ||
177 | argv[1], | ||
178 | strerror (errno)); | ||
179 | libvlc_release (vlc); | ||
180 | return; | ||
181 | } | ||
182 | media = libvlc_media_new_fd (vlc, | ||
183 | fd); | ||
184 | } | ||
166 | if (NULL == media) | 185 | if (NULL == media) |
167 | { | 186 | { |
168 | fprintf (stderr, | 187 | fprintf (stderr, |