Commit c51ce947 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* Fix mp4 relative ref. files (this was already fixed in trunk)

parent e34e9d8c
...@@ -368,7 +368,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -368,7 +368,7 @@ static int Open( vlc_object_t * p_this )
char *psz_ref; char *psz_ref;
uint32_t i_ref_type; uint32_t i_ref_type;
if( !p_rdrf || !( psz_ref = p_rdrf->data.p_rdrf->psz_ref ) ) if( !p_rdrf || !( psz_ref = strdup( p_rdrf->data.p_rdrf->psz_ref ) ) )
{ {
continue; continue;
} }
...@@ -387,57 +387,38 @@ static int Open( vlc_object_t * p_this ) ...@@ -387,57 +387,38 @@ static int Open( vlc_object_t * p_this )
if( !strncmp( psz_ref, "http://", 7 ) || if( !strncmp( psz_ref, "http://", 7 ) ||
!strncmp( psz_ref, "rtsp://", 7 ) ) !strncmp( psz_ref, "rtsp://", 7 ) )
{ {
msg_Dbg( p_demux, "adding ref = `%s'", psz_ref ); ;
if( p_item )
{
playlist_item_t *p_child =
playlist_ItemNew( p_playlist,
psz_ref, psz_ref );
if( p_child )
{
playlist_NodeAddItem( p_playlist, p_child,
p_item->pp_parents[0]->i_view,
p_item, PLAYLIST_APPEND,
PLAYLIST_END );
playlist_CopyParents( p_item, p_child );
b_play = VLC_TRUE;
}
}
} }
else else
{ {
/* msg dbg relative ? */ char *psz_absolute;
int i_path_size = strlen( p_demux->psz_access ) + 3 + char *psz_path = strdup( p_demux->psz_path );
strlen( p_demux->psz_path ) + strlen( psz_ref ) + 1; char *end = strrchr( psz_path, '/' );
char psz_absolute[i_path_size];
char *end = strrchr( p_demux->psz_path, '/' );
if( end ) if( end ) end[1] = '\0';
{ else *psz_path = '\0';
snprintf( psz_absolute, i_path_size, "%s://%s",
p_demux->psz_access, p_demux->psz_path ); asprintf( &psz_absolute, "%s://%s%s",
} p_demux->psz_access, psz_path, psz_ref );
else
{ if( psz_ref ) free( psz_ref );
*psz_absolute = '\0'; psz_ref = psz_absolute;
} free( psz_path );
strcat( psz_absolute, psz_ref ); }
msg_Dbg( p_demux, "adding ref = `%s'", psz_absolute ); msg_Dbg( p_demux, "adding ref = `%s'", psz_ref );
if( p_item ) if( p_item )
{
playlist_item_t *p_child =
playlist_ItemNew( p_playlist,
psz_ref, psz_ref );
if( p_child )
{ {
playlist_item_t *p_child = playlist_NodeAddItem( p_playlist, p_child,
playlist_ItemNew( p_playlist, p_item->pp_parents[0]->i_view,
psz_absolute, p_item, PLAYLIST_APPEND,
psz_absolute ); PLAYLIST_END );
if( p_child ) playlist_CopyParents( p_item, p_child );
{ b_play = VLC_TRUE;
playlist_NodeAddItem( p_playlist, p_child,
p_item->pp_parents[0]->i_view,
p_item, PLAYLIST_APPEND,
PLAYLIST_END );
playlist_CopyParents( p_item, p_child );
b_play = VLC_TRUE;
}
} }
} }
} }
...@@ -446,6 +427,7 @@ static int Open( vlc_object_t * p_this ) ...@@ -446,6 +427,7 @@ static int Open( vlc_object_t * p_this )
msg_Err( p_demux, "unknown ref type=%4.4s FIXME (send a bug report)", msg_Err( p_demux, "unknown ref type=%4.4s FIXME (send a bug report)",
(char*)&p_rdrf->data.p_rdrf->i_ref_type ); (char*)&p_rdrf->data.p_rdrf->i_ref_type );
} }
if( psz_ref ) free( psz_ref );
} }
if( b_play == VLC_TRUE ) if( b_play == VLC_TRUE )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment