[vlc-devel] M3U issue
Pierre d'Herbemont
pdherbemont at gmail.com
Mon Aug 10 11:58:22 CEST 2009
On Aug 9, 2009, at 5:46 PM, Andre-John Mas wrote:
>
> On 9-Aug-2009, at 09:09, Pierre d'Herbemont wrote:
>
>>
>> On Aug 9, 2009, at 2:41 PM, Rémi Denis-Courmont wrote:
>>
>>> Le dimanche 9 août 2009 15:34:37 Pierre d'Herbemont, vous avez
>>> écrit :
>>>> This is an HTTP streaming file. VLC does not yet support it.
>>>
>>> Well, VLC should still be able to open the files sequentially,
>>> although that
>>> means an annoying pause every so many seconds.
>>
>> Right, there is a side bug here.
>>
>> Playback is not working because the m3u code adds file:// sub input
>> item, instead of http:// items.
>>
>
> Is it adding file:// or simply ignoring to add the protocol at the
> front of the path? Sorry for
> my ignorance, I am still trying to understand the VLC code.
It's actually ignoring the protocol. Thus defaulting to file://.
I am not able to build vlc at this time, but here is a patch you could
try and fix.
Pierre.
diff --git a/modules/demux/playlist/playlist.c b/modules/demux/
playlist/playlist.c
index b9731da..4a348de 100644
--- a/modules/demux/playlist/playlist.c
+++ b/modules/demux/playlist/playlist.c
@@ -175,6 +175,7 @@ char *FindPrefix( demux_t *p_demux )
char *psz_file;
char *psz_prefix;
const char *psz_path = p_demux->psz_path;
+ const char *psz_access = p_demux->psz_access;
#ifdef WIN32
psz_file = strrchr( psz_path, '\\' );
@@ -182,10 +183,16 @@ char *FindPrefix( demux_t *p_demux )
#endif
psz_file = strrchr( psz_path, '/' );
+ char psz_parent_path[MAX_PATH] = "";
if( psz_file )
- psz_prefix = strndup( psz_path, psz_file - psz_path + 1 );
- else
- psz_prefix = strdup( "" );
+ {
+ strncpy( psz_parent_path, psz_path, MIN(psz_file - psz_path +
1, MAX_PATH) );
+ psz_parent_path[MAX_PATH-1] = 0;
+ }
+
+ int ret = asprintf( &psz_prefix, "%s://%s", psz_access,
psz_parent_path );
+ if (ret == -1)
+ return NULL;
return psz_prefix;
}
More information about the vlc-devel
mailing list