Commit e5daac69 authored by Arnaud Schauly's avatar Arnaud Schauly

* Added a session announcement protol module (enabled by default).

* Added the PLAYLIST_CHECK_INSERT option to the playlist. That option
checks previously enqueued sessions before enqueing.
parent e133e074
......@@ -625,7 +625,7 @@ PLUGINS="${PLUGINS} wav araw demuxdump demuxsub"
dnl
dnl Network modules
dnl
NETWORK_MODULES="access_udp access_http access_rtp ipv4 access_mms"
NETWORK_MODULES="access_udp access_http access_rtp ipv4 access_mms sap"
dnl
dnl Accelerated modules
......
......@@ -2,7 +2,7 @@
* vlc.h: global header for vlc
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc.h,v 1.17 2002/10/17 13:15:30 sam Exp $
* $Id: vlc.h,v 1.18 2002/12/03 16:29:04 gitan Exp $
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -74,10 +74,11 @@ typedef union
*****************************************************************************/
/* Used by playlist_Add */
#define PLAYLIST_INSERT 0x0001
#define PLAYLIST_REPLACE 0x0002
#define PLAYLIST_APPEND 0x0004
#define PLAYLIST_GO 0x0008
#define PLAYLIST_INSERT 0x0001
#define PLAYLIST_REPLACE 0x0002
#define PLAYLIST_APPEND 0x0004
#define PLAYLIST_GO 0x0008
#define PLAYLIST_CHECK_INSERT 0x0010
#define PLAYLIST_END -666
......
SOURCES_gtk_main = modules/misc/gtk_main.c
SOURCES_gnome_main = modules/misc/gtk_main.c
SOURCES_sap = modules/misc/sap.c
This diff is collapsed.
......@@ -2,7 +2,7 @@
* libvlc.c: main libvlc source
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.c,v 1.48 2002/11/28 17:35:00 sam Exp $
* $Id: libvlc.c,v 1.49 2002/12/03 16:29:04 gitan Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -755,7 +755,15 @@ int VLC_Play( int i_object )
{
return VLC_ENOOBJ;
}
/* add pseudo sap interface; non blocking */
if( config_GetInt( p_vlc, "sap" ) )
{
msg_Dbg( p_vlc, "adding sap interface" );
VLC_AddIntf( 0, "sap", VLC_FALSE );
}
p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST, FIND_CHILD );
if( !p_playlist )
......
......@@ -2,7 +2,7 @@
* libvlc.h: main libvlc header
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: libvlc.h,v 1.24 2002/12/03 12:59:21 sam Exp $
* $Id: libvlc.h,v 1.25 2002/12/03 16:29:04 gitan Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -358,6 +358,10 @@
"\n vlc:quit quit VLC" \
"\n")
#define SAP_TEXT N_( "Session Announcement Protocol support" )
#define SAP_LONGTEXT N_( "Session Announcement Protocol support" )
/*
* Quick usage guide for the configuration options:
*
......@@ -475,6 +479,7 @@ vlc_module_begin();
/* Misc options */
add_category_hint( N_("Miscellaneous"), NULL );
add_bool( "sap", 1, NULL, SAP_TEXT, SAP_LONGTEXT );
add_module( "memcpy", "memcpy", NULL, NULL, MEMCPY_TEXT, MEMCPY_LONGTEXT );
add_module( "access", "access", NULL, NULL, ACCESS_TEXT, ACCESS_LONGTEXT );
add_module( "demux", "demux", NULL, NULL, DEMUX_TEXT, DEMUX_LONGTEXT );
......
......@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.23 2002/11/21 15:51:57 gbazin Exp $
* $Id: playlist.c,v 1.24 2002/12/03 16:29:04 gitan Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -105,8 +105,37 @@ int playlist_Add( playlist_t *p_playlist, const char * psz_target,
{
playlist_item_t *p_item;
msg_Dbg( p_playlist, "adding playlist item %s ", psz_target );
vlc_mutex_lock( &p_playlist->object_lock );
/*
* CHECK_INSERT : checks if the item is already enqued before
* enqueing it
*/
if ( i_mode & PLAYLIST_CHECK_INSERT )
{
int j;
if ( p_playlist->pp_items )
{
for ( j = 0; j < p_playlist->i_size; j++ )
{
if ( !strcmp( p_playlist->pp_items[j]->psz_name, psz_target ) )
{
msg_Dbg( p_playlist, "item %s already enqued",
psz_target );
vlc_mutex_unlock( &p_playlist->object_lock );
return 0;
}
}
}
i_mode &= ~PLAYLIST_CHECK_INSERT;
i_mode |= PLAYLIST_APPEND;
}
msg_Dbg( p_playlist, "adding playlist item %s ", psz_target );
/* Create the new playlist item */
p_item = malloc( sizeof( playlist_item_t ) );
if( p_item == NULL )
......@@ -119,7 +148,6 @@ int playlist_Add( playlist_t *p_playlist, const char * psz_target,
p_item->i_status = 0;
p_item->b_autodeletion = VLC_FALSE;
vlc_mutex_lock( &p_playlist->object_lock );
/* Do a few boundary checks and allocate space for the item */
if( i_pos == PLAYLIST_END )
......
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