libvlc_media_new_path() possible bug in version 2.1.3

This forum is about all development around libVLC.
AndresH
New Cone
New Cone
Posts: 9
Joined: 12 Sep 2012 00:57

libvlc_media_new_path() possible bug in version 2.1.3

Postby AndresH » 24 Jul 2014 08:02

I've been using this:

Code: Select all

libvlc_media_new_path(libvlc, url);
with url assigned to

Code: Select all

"rtsp:\\169.254.102.233\h264"
without problems with versions up to 2.0.1

Now with version 2.1.3 it assumes that the url is a file.

Because It logs the following:

libdvdnav: Using dvdnav version 5.0.0
libdvdread: Could not open C:\prj\MyProject\rtsp:\\169.254.102.233\h264 with libdvdcss.
libdvdread: Can't open C:\prj\MyProject\rtsp:\\169.254.102.233\h264 for reading
libdvdnav: vm: failed to open/read the DVD
[06666f34] filesystem access error: cannot open file C:\prj\MyProject\rtsp:\\169.254.102.233\h264 (Invalid argument)
[06666f34] main access error: File reading failed



So, it is using the current working directory and then concatenating url contents. Prior versions were using just url contents.

So my question to the board is if you people think that this is an error to be reported or if you think that I am making a bad use of the function.

Thanks.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc_media_new_path() possible bug in version 2.1.3

Postby sherington » 24 Jul 2014 09:04

You're supposed to use libvlc_media_new_location for things that aren't actual file paths.

AndresH
New Cone
New Cone
Posts: 9
Joined: 12 Sep 2012 00:57

Re: libvlc_media_new_path() possible bug in version 2.1.3

Postby AndresH » 26 Jul 2014 07:12

Thank you very much for your reply. After posting my previous I've found that in the documentation.

So, previous version was accepting rtsp streams and files.

Now it seems to be neccesary to distinguish that before calling lib_vlc_media_new_path() or libvlc_media_new_location(), depending on the case.

If it is that way, it seems that the new is worse than the previous. So, is there a way of checking if a string is a file or a stream, in order to call the right function ?

If not, programs will need to ask the user: "is this a network camera or a file ?" or things like that.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: libvlc_media_new_path() possible bug in version 2.1.3

Postby sherington » 26 Jul 2014 20:43

You don't need to ask the user, some simple pattern matching should be enough.

i.e. local files don't look like URLs like "protocol://...", so match that.

I do this, it works just fine for everything I play.

Rémi Denis-Courmont
Developer
Developer
Posts: 15268
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: libvlc_media_new_path() possible bug in version 2.1.3

Postby Rémi Denis-Courmont » 26 Jul 2014 22:20

Now it seems to be neccesary to distinguish that before calling lib_vlc_media_new_path() or libvlc_media_new_location(), depending on the case.
The two separate functions are not new. The documentation always made the distinction already in previous releases.
So, is there a way of checking if a string is a file or a stream, in order to call the right function ?
Not generally since some strings are both syntactically valid file paths and URLs. That is why LibVLC cannot figure it out for you.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 43 guests