static void CloseDemux ( vlc_object_t * );
vlc_module_begin();
- set_description( _("SAP interface") );
+ set_shortname( _("SAP"));
+ set_description( _("SAP announces") );
set_category( CAT_PLAYLIST );
set_subcategory( SUBCAT_PLAYLIST_SD );
uint8_t *p_peek;
int i_max_sdp = 1024;
int i_sdp = 0;
- char *psz_sdp = (char *)malloc( i_max_sdp );
+ char *psz_sdp = NULL;
sdp_t *p_sdp = NULL;
- if( !psz_sdp )
- {
- return VLC_EGENERIC;
- }
-
/* Probe for SDP */
if( p_demux->s )
{
- if( stream_Peek( p_demux->s, &p_peek, 7 ) < 7 )
- {
- msg_Err( p_demux, "cannot peek" );
- return VLC_EGENERIC;
- }
+ if( stream_Peek( p_demux->s, &p_peek, 7 ) < 7 ) return VLC_EGENERIC;
+
if( strncmp( (char*)p_peek, "v=0\r\n", 5 ) &&
strncmp( (char*)p_peek, "v=0\n", 4 ) &&
( p_peek[0] < 'a' || p_peek[0] > 'z' || p_peek[1] != '=' ) )
{
- msg_Warn( p_demux, "SDP (UDP) module discarded" );
return VLC_EGENERIC;
}
}
+ psz_sdp = (char *)malloc( i_max_sdp );
+ if( !psz_sdp ) return VLC_EGENERIC;
+
/* Gather the complete sdp file */
for( ;; )
{
{
p_sdp->psz_uri = NULL;
}
- if( p_sdp->i_media_type != 33 && p_sdp->i_media_type != 32 && p_sdp->i_media_type != 14 )
+ if( p_sdp->i_media_type != 33 && p_sdp->i_media_type != 32 &&
+ p_sdp->i_media_type != 14 )
goto error;
if( p_sdp->psz_uri == NULL ) goto error;
if( p_playlist )
{
- playlist_NodeDelete( p_playlist, p_sys->p_node, VLC_TRUE );
+ playlist_NodeDelete( p_playlist, p_sys->p_node, VLC_TRUE , VLC_TRUE );
vlc_object_release( p_playlist );
}
PLAYLIST_APPEND, PLAYLIST_END );
vlc_object_release( p_playlist );
- if( p_sdp ) FreeSDP( p_sdp );
+ if( p_sdp ) FreeSDP( p_sdp );
return VLC_SUCCESS;
}
/* First, check the sap announce is correct */
i_version = p_buffer[0] >> 5;
-
if( i_version != 1 )
{
msg_Dbg( p_sd, "strange sap version %d found", i_version );
return NULL;
}
+ psz_value = GetAttribute( p_sap->p_sdp, "tool" );
+ if( psz_value != NULL )
+ {
+ vlc_input_item_AddInfo( &p_item->input, _("Session"),
+ _("Tool"), psz_value );
+ }
+ if( strcmp( p_sdp->psz_username, "-" ) )
+ {
+ vlc_input_item_AddInfo( &p_item->input, _("Session"),
+ _("User"), p_sdp->psz_username );
+ }
+
psz_value = GetAttribute( p_sap->p_sdp, "x-plgroup" );
if( psz_value == NULL )
}
p_item->i_flags &= ~PLAYLIST_SKIP_FLAG;
+ p_item->i_flags &= ~PLAYLIST_SAVE_FLAG;
playlist_NodeAddItem( p_playlist, p_item, VIEW_CATEGORY, p_child,
PLAYLIST_APPEND, PLAYLIST_END );
}
else
{
- msg_Dbg( p_obj, "incorrect c field");
+ msg_Dbg( p_obj, "incorrect c field, %s", p_sdp->psz_connection );
}
psz_uri = strdup( psz_parse );
}
else
{
- msg_Dbg( p_obj, "incorrect m field");
+ msg_Dbg( p_obj, "incorrect m field, %s", p_sdp->psz_media );
p_sdp->i_media_type = 33;
psz_proto = strdup( psz_parse );
}
free( psz_proto );
psz_proto = strdup( "udp" );
}
-
/* FIXME: HTTP support */
sdp_t *p_sdp;
vlc_bool_t b_invalid = VLC_FALSE;
vlc_bool_t b_end = VLC_FALSE;
-
if( psz_sdp == NULL )
{
return NULL;