Commit ad77d955 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Merge branch 1.0-bugfix (early part) into master

parents 3bc0ec07 4db7858c
......@@ -656,6 +656,7 @@ ifdef HAVE_WIN32
(cd $<; $(HOSTCC) make $(LUA_MAKEPLATEFORM); cd src; $(HOSTCC) make liblua.a; cd ..;$(HOSTCC) make install INSTALL_TOP=$(PREFIX); $(RANLIB) $(PREFIX)/lib/liblua.a)
(cd $<; sed -i.orig 's@prefix= /usr/local@prefix= $(PREFIX)@' etc/lua.pc; mkdir -p $(PREFIX)/lib/pkgconfig; cp etc/lua.pc $(PREFIX)/lib/pkgconfig)
else
(cd $<; patch -p1) < Patches/lua-noreadline.patch
(cd $<; $(HOSTCC) make $(LUA_MAKEPLATEFORM) && make install INSTALL_TOP=$(PREFIX))
endif
touch $@
......
LUA: do not use readline on Linux
diff -ru lua-5.1/src/Makefile lua/src/Makefile
--- lua-5.1/src/Makefile 2006-02-16 17:45:09.000000000 +0200
+++ lua/src/Makefile 2009-02-09 23:35:21.000000000 +0200
@@ -92,7 +92,7 @@
$(MAKE) all MYCFLAGS=
linux:
- $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
+ $(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl"
macosx:
$(MAKE) all MYCFLAGS=-DLUA_USE_MACOSX
diff -ru lua-5.1/src/luaconf.h lua/src/luaconf.h
--- lua-5.1/src/luaconf.h 2006-02-10 19:44:06.000000000 +0200
+++ lua/src/luaconf.h 2009-02-09 23:33:29.000000000 +0200
@@ -36,7 +36,6 @@
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
-#define LUA_USE_READLINE /* needs some extra libraries */
#endif
#if defined(LUA_USE_MACOSX)
......@@ -219,6 +219,9 @@ typedef enum
RTSP_CMD_TYPE_SEEK,
RTSP_CMD_TYPE_REWIND,
RTSP_CMD_TYPE_FORWARD,
RTSP_CMD_TYPE_ADD,
RTSP_CMD_TYPE_DEL,
} rtsp_cmd_type_t;
/* */
......@@ -226,7 +229,7 @@ typedef struct
{
int i_type;
int i_media_id;
//vod_media_t *p_media;
vod_media_t *p_media;
char *psz_session;
char *psz_arg;
double f_arg;
......@@ -234,6 +237,7 @@ typedef struct
static vod_media_t *MediaNew( vod_t *, const char *, input_item_t * );
static void MediaDel( vod_t *, vod_media_t * );
static void MediaAskDel ( vod_t *, vod_media_t * );
static int MediaAddES( vod_t *, vod_media_t *, es_format_t * );
static void MediaDelES( vod_t *, vod_media_t *, es_format_t * );
......@@ -313,7 +317,7 @@ static int Open( vlc_object_t *p_this )
p_sys->i_media_id = 0;
p_vod->pf_media_new = MediaNew;
p_vod->pf_media_del = MediaDel;
p_vod->pf_media_del = MediaAskDel;
p_vod->pf_media_add_es = MediaAddES;
p_vod->pf_media_del_es = MediaDelES;
......@@ -361,6 +365,8 @@ static void Close( vlc_object_t * p_this )
p_block_cmd = block_FifoGet( p_sys->p_fifo_cmd );
memcpy( &cmd, p_block_cmd->p_buffer, sizeof(cmd) );
block_Release( p_block_cmd );
if ( cmd.i_type == RTSP_CMD_TYPE_DEL )
MediaDel(p_vod, cmd.p_media);
free( cmd.psz_session );
free( cmd.psz_arg );
}
......@@ -453,10 +459,6 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
p_media->p_vod = p_vod;
vlc_mutex_lock( &p_sys->lock_media );
TAB_APPEND( p_sys->i_media, p_sys->media, p_media );
vlc_mutex_unlock( &p_sys->lock_media );
vlc_mutex_init( &p_media->lock );
p_media->psz_session_name = strdup("");
p_media->psz_session_description = strdup("");
......@@ -480,9 +482,15 @@ static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
}
vlc_mutex_unlock( &p_item->lock );
CommandPush( p_vod, RTSP_CMD_TYPE_ADD, p_media, NULL, 0.0, NULL );
return p_media;
}
static void MediaAskDel ( vod_t *p_vod, vod_media_t *p_media )
{
CommandPush( p_vod, RTSP_CMD_TYPE_DEL, p_media, NULL, 0.0, NULL );
}
static void MediaDel( vod_t *p_vod, vod_media_t *p_media )
{
vod_sys_t *p_sys = p_vod->p_sys;
......@@ -808,6 +816,7 @@ static void CommandPush( vod_t *p_vod, rtsp_cmd_type_t i_type, vod_media_t *p_me
memset( &cmd, 0, sizeof(cmd) );
cmd.i_type = i_type;
cmd.p_media = p_media;
if( p_media )
cmd.i_media_id = p_media->id;
if( psz_session )
......@@ -844,6 +853,20 @@ static void* CommandThread( vlc_object_t *p_this )
if( cmd.i_type == RTSP_CMD_TYPE_NONE )
break;
if ( cmd.i_type == RTSP_CMD_TYPE_ADD )
{
vlc_mutex_lock( &p_sys->lock_media );
TAB_APPEND( p_sys->i_media, p_sys->media, cmd.p_media );
vlc_mutex_unlock( &p_sys->lock_media );
goto next;
}
if ( cmd.i_type == RTSP_CMD_TYPE_DEL )
{
MediaDel(p_vod, cmd.p_media);
goto next;
}
/* */
vlc_mutex_lock( &p_sys->lock_media );
for( i = 0; i < p_sys->i_media; i++ )
......@@ -852,7 +875,10 @@ static void* CommandThread( vlc_object_t *p_this )
break;
}
if( i >= p_sys->i_media )
{
vlc_mutex_unlock( &p_sys->lock_media );
goto next;
}
p_media = p_sys->media[i];
switch( cmd.i_type )
......@@ -888,9 +914,9 @@ static void* CommandThread( vlc_object_t *p_this )
default:
break;
}
vlc_mutex_unlock( &p_sys->lock_media );
next:
vlc_mutex_unlock( &p_sys->lock_media );
free( cmd.psz_session );
free( cmd.psz_arg );
}
......
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