modules/misc/sap.c:

 * fixed playback of sap anounces through livdotcom
parent d979a751
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* sap.c : SAP interface module * sap.c : SAP interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: sap.c,v 1.45 2004/01/05 14:42:14 zorglub Exp $ * $Id: sap.c,v 1.46 2004/01/15 19:21:03 sigmunau Exp $
* *
* Authors: Arnaud Schauly <gitan@via.ecp.fr> * Authors: Arnaud Schauly <gitan@via.ecp.fr>
* Clment Stenac <zorglub@via.ecp.fr> * Clment Stenac <zorglub@via.ecp.fr>
...@@ -655,16 +655,7 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd ) ...@@ -655,16 +655,7 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
psz_uri_default = NULL; psz_uri_default = NULL;
if( p_sd->i_media > 1 ) if( p_sd->i_media > 1 )
{ {
psz_uri = malloc( strlen( p_sd->psz_sdp ) + 7 ); asprintf( &psz_uri, "sdp://%s", p_sd->psz_sdp );
if( psz_uri == NULL )
{
msg_Warn( p_intf, "out of memory" );
return;
}
memcpy( psz_uri, "sdp://", 6 );
psz_uri += 6;
memcpy( psz_uri, p_sd->psz_sdp, strlen( p_sd->psz_sdp ) + 1 );
/* Check if we have already added the item */ /* Check if we have already added the item */
for( i = 0 ; i< p_intf->p_sys->i_announces ; i++ ) for( i = 0 ; i< p_intf->p_sys->i_announces ; i++ )
{ {
...@@ -679,9 +670,12 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd ) ...@@ -679,9 +670,12 @@ static void sess_toitem( intf_thread_t * p_intf, sess_descr_t * p_sd )
FIND_ANYWHERE ); FIND_ANYWHERE );
i_id = playlist_Add( p_playlist, psz_uri, p_sd->psz_sessionname , i_id = playlist_Add( p_playlist, psz_uri, p_sd->psz_sessionname ,
PLAYLIST_CHECK_INSERT, PLAYLIST_END ); PLAYLIST_CHECK_INSERT, PLAYLIST_END );
if( i_id != -1 )
i_pos = playlist_GetPositionById( p_playlist, i_id ); {
playlist_SetGroup( p_playlist, i_pos, p_intf->p_sys->i_group ); i_pos = playlist_GetPositionById( p_playlist, i_id );
playlist_SetGroup( p_playlist, i_pos, p_intf->p_sys->i_group );
}
free( psz_uri );
/* Remember it */ /* Remember it */
p_announce = (struct sap_announce_t *)malloc( p_announce = (struct sap_announce_t *)malloc(
......
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