Commit c7bc1acb authored by Clément Stenac's avatar Clément Stenac

Support for announcement of playlist group in SAP announces

Needs the latest miniSAPserver CVS
parent 5edf9f31
......@@ -2,7 +2,7 @@
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.15 2003/10/29 17:32:54 zorglub Exp $
* $Id: vlc_playlist.h,v 1.16 2003/11/12 08:10:21 zorglub Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -130,6 +130,7 @@ VLC_EXPORT( int, playlist_EnableGroup, ( playlist_t *, int ) );
VLC_EXPORT( playlist_group_t *, playlist_CreateGroup, (playlist_t *, char* ) );
VLC_EXPORT( int, playlist_DeleteGroup, (playlist_t *, int ) );
VLC_EXPORT( char *, playlist_FindGroup, (playlist_t *, int ) );
VLC_EXPORT( int, playlist_GroupToId, (playlist_t *, char * ) );
VLC_EXPORT( int, playlist_SortTitle, ( playlist_t *, int) );
VLC_EXPORT( int, playlist_SortAuthor, ( playlist_t *, int) );
......
......@@ -2,7 +2,7 @@
* sap.c : SAP interface module
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.33 2003/11/08 23:02:38 sigmunau Exp $
* $Id: sap.c,v 1.34 2003/11/12 08:10:21 zorglub Exp $
*
* Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr>
......@@ -464,7 +464,7 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
int i_count , i;
vlc_bool_t b_http = VLC_FALSE;
char *psz_http_path = NULL;
playlist_t *p_playlist;
playlist_t *p_playlist = NULL;
psz_uri_default = NULL;
cfield_parse( p_sd->psz_connection, &psz_uri_default );
......@@ -529,6 +529,31 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
{
psz_http_path = strdup( p_sd->pp_attributes[i]->psz_value );
}
if(!strcasecmp( p_sd->pp_attributes[i]->psz_field , "plgroup"))
{
p_playlist =
(playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
int i_id=playlist_GroupToId( p_playlist,
p_sd->pp_attributes[i]->psz_value);
if( i_id != 0 )
{
p_item->i_group = i_id;
}
else
{
playlist_group_t *p_group =
playlist_CreateGroup( p_playlist,
p_sd->pp_attributes[i]->psz_value);
p_item->i_group = p_group->i_id;
}
vlc_object_release( p_playlist );
}
}
......@@ -794,4 +819,3 @@ static ssize_t NetRead( intf_thread_t *p_intf,
return 0;
#endif
}
......@@ -2,7 +2,7 @@
* playlist.c : Playlist groups management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: group.c,v 1.1 2003/10/29 18:00:46 zorglub Exp $
* $Id: group.c,v 1.2 2003/11/12 08:10:21 zorglub Exp $
*
* Authors: Clment Stenac <zorglub@videolan.org>
*
......@@ -124,3 +124,26 @@ char *playlist_FindGroup( playlist_t *p_playlist, int i_id )
}
return NULL;
}
/**
* Find the Id with the given name
*
* \param p_playlist the playlist where to find the group
* \param char * the name to search for
* \return the id of the group
*/
int playlist_GroupToId( playlist_t *p_playlist, char *psz_name )
{
int i;
for( i=0 ; i< p_playlist->i_groups; i++ )
{
if( p_playlist->pp_groups[i]->psz_name)
{
if( ! strcasecmp( p_playlist->pp_groups[i]->psz_name , psz_name ) )
{
return p_playlist->pp_groups[i]->i_id;
}
}
}
return 0;
}
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