* intf_playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_playlist.c,v 1.4 2001/05/07 03:14:09 stef Exp $
+ * $Id: intf_playlist.c,v 1.7 2001/05/30 17:03:12 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
p_playlist->i_mode = PLAYLIST_FORWARD;
p_playlist->i_seed = 0;
+ p_playlist->b_stopped = 0;
/* There is no current item */
p_playlist->current.i_type = 0;
}
/*****************************************************************************
- * intf_PlaylistJumpto
+ * intf_PlaylistJumpto: go to a specified position in playlist.
*****************************************************************************/
void intf_PlaylistJumpto( playlist_t * p_playlist , int i_pos)
{
{
free( p_playlist->current.psz_name );
}
+
p_playlist->current = p_playlist->p_item[ p_playlist->i_index ];
p_playlist->current.psz_name
= strdup( p_playlist->current.psz_name );
- }
+
+ }
+ p_main->p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_playlist->change_lock );
}
+/* URL-decode a file: URL path, return NULL if it's not what we expect */
+void intf_UrlDecode( char *encoded_path )
+{
+ char *tmp = NULL, *cur = NULL, *ext = NULL;
+ int realchar;
+
+ if( !encoded_path || *encoded_path == '\0' )
+ {
+ return;
+ }
+
+ cur = encoded_path ;
+
+ tmp = calloc(strlen(encoded_path) + 1, sizeof(char) );
+
+ while ( ( ext = strchr(cur, '%') ) != NULL)
+ {
+ strncat(tmp, cur, (ext - cur) / sizeof(char));
+ ext++;
+
+ if (!sscanf(ext, "%2x", &realchar))
+ {
+ free(tmp);
+ return;
+ }
+
+ tmp[strlen(tmp)] = (char)realchar;
+
+ cur = ext + 2;
+ }
+
+ strcat(tmp, cur);
+ strcpy(encoded_path,tmp);
+}
/*****************************************************************************
* Following functions are local