]> git.sesse.net Git - vlc/commitdiff
* ./modules/misc/gtk_main.c: created the gtk_main module, which simply runs
authorSam Hocevar <sam@videolan.org>
Tue, 20 Aug 2002 18:08:51 +0000 (18:08 +0000)
committerSam Hocevar <sam@videolan.org>
Tue, 20 Aug 2002 18:08:51 +0000 (18:08 +0000)
    gtk_main() in its own thread, and does nothing on subsequent calls. This
    ensures that gtk_main is only running once.
  * ./modules/gui/familiar/*, modules/gui/gtk/*: the familiar, gtk and gnome
    modules are now fully reentrant thanks to their use of the gtk_main module.
  * ./src/libvlc.c: implemented vlc_set(), a wrapper for config_Put* available
    to external programs.
  * ./src/libvlc.c: removed vlc_stop() and vlc_end(), everything is now done
    by vlc_destroy().
  * ./modules/control/rc/rc.c: implemented a few new functions. For instance,
    run "vlc -I rc" and then type "intf gtk" or "intf gnome". You can even
    launch several of them. "segfault" works, too.

20 files changed:
Makefile.opts.in
configure
configure.in
debian/rules
include/main.h
include/vlc/vlc.h
modules/control/rc/rc.c
modules/gui/familiar/familiar.c
modules/gui/familiar/familiar.h
modules/gui/gtk/common.h
modules/gui/gtk/gnome.c
modules/gui/gtk/gtk.c
modules/misc/.cvsignore [moved from modules/misc/null/.cvsignore with 100% similarity]
modules/misc/Makefile [new file with mode: 0644]
modules/misc/gtk_main.c [new file with mode: 0644]
modules/misc/null.c [moved from modules/misc/null/null.c with 96% similarity]
modules/misc/null/Makefile [deleted file]
mozilla/vlcplugin.c
src/libvlc.c
src/vlc.c

index 8fc89253d1f9edcb6d5c6f9fbe6d9010890fbfd3..e0bafc36bf73707eaf3512dc2f83ad1c49da09c3 100644 (file)
@@ -72,6 +72,7 @@ ffmpeg_CFLAGS = @ffmpeg_CFLAGS@
 glide_CFLAGS = @glide_CFLAGS@
 gnome_CFLAGS = @gnome_CFLAGS@
 gtk_CFLAGS = @gtk_CFLAGS@
+gtk_main_CFLAGS = @gtk_main_CFLAGS@
 idctaltivec_CFLAGS = @idctaltivec_CFLAGS@
 kde_CFLAGS = @kde_CFLAGS@
 mad_CFLAGS = @mad_CFLAGS@
@@ -113,6 +114,7 @@ ggi_LDFLAGS = @ggi_LDFLAGS@
 glide_LDFLAGS = @glide_LDFLAGS@
 gnome_LDFLAGS = @gnome_LDFLAGS@
 gtk_LDFLAGS = @gtk_LDFLAGS@
+gtk_main_LDFLAGS = @gtk_main_LDFLAGS@
 http_LDFLAGS = @http_LDFLAGS@
 idctaltivec_LDFLAGS = @idctaltivec_LDFLAGS@
 imdct_LDFLAGS = @imdct_LDFLAGS@
index 4468086def95b02c742a2bdd48bdde94697c0956..f4e0ad7a277b7b9e3e0d5bd61705b91e6da1fee4 100755 (executable)
--- a/configure
+++ b/configure
@@ -5063,6 +5063,8 @@ if test "x${x_libraries}" = "xNONE"; then
   x_libraries="/usr/X11R6/lib"
 fi
 
+NEED_GTK_MAIN=no
+
 if test "x${SYS}" != "xmingw32"
 then
   CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
@@ -5070,17 +5072,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5074: checking for $ac_hdr" >&5
+echo "configure:5076: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5079 "configure"
+#line 5081 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5102,7 +5104,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
     cat > conftest.$ac_ext <<EOF
-#line 5106 "configure"
+#line 5108 "configure"
 #include "confdefs.h"
 #include <X11/extensions/dpms.h>
 EOF
@@ -5128,20 +5130,20 @@ done
 fi
 
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:5132: checking for ntohl in sys/param.h" >&5
+echo "configure:5134: checking for ntohl in sys/param.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_ntohl_sys_param_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -Wall -Werror"
      cat > conftest.$ac_ext <<EOF
-#line 5138 "configure"
+#line 5140 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 int main() {
 void foo() { int meuh; ntohl(meuh); }
 ; return 0; }
 EOF
-if { (eval echo configure:5145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_ntohl_sys_param_h=yes
 else
@@ -5162,20 +5164,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6
-echo "configure:5166: checking if \$CC accepts -finline-limit" >&5
+echo "configure:5168: checking if \$CC accepts -finline-limit" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline_limit'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -finline-limit-30000"
      cat > conftest.$ac_ext <<EOF
-#line 5172 "configure"
+#line 5174 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline_limit=yes
 else
@@ -5193,20 +5195,20 @@ if test "x${ac_cv_c_inline_limit}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -Wall -Winline""... $ac_c" 1>&6
-echo "configure:5197: checking if \$CC accepts -Wall -Winline" >&5
+echo "configure:5199: checking if \$CC accepts -Wall -Winline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_Wall_Winline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="-Wall -Winline ${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5203 "configure"
+#line 5205 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5210: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_Wall_Winline=yes
 else
@@ -5223,20 +5225,20 @@ if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
     save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
 else
     echo $ac_n "checking if \$CC accepts -wall -winline""... $ac_c" 1>&6
-echo "configure:5227: checking if \$CC accepts -wall -winline" >&5
+echo "configure:5229: checking if \$CC accepts -wall -winline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_wall_winline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="-wall -winline ${save_CFLAGS}"
          cat > conftest.$ac_ext <<EOF
-#line 5233 "configure"
+#line 5235 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5240: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_wall_winline=yes
 else
@@ -5255,20 +5257,20 @@ echo "$ac_t""$ac_cv_c_wall_winline" 1>&6
 fi
 
 echo $ac_n "checking if \$CC accepts -pipe""... $ac_c" 1>&6
-echo "configure:5259: checking if \$CC accepts -pipe" >&5
+echo "configure:5261: checking if \$CC accepts -pipe" >&5
 if eval "test \"`echo '$''{'ac_cv_c_pipe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -pipe"
      cat > conftest.$ac_ext <<EOF
-#line 5265 "configure"
+#line 5267 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_pipe=yes
 else
@@ -5286,20 +5288,20 @@ if test "x${ac_cv_c_pipe}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -O3""... $ac_c" 1>&6
-echo "configure:5290: checking if \$CC accepts -O3" >&5
+echo "configure:5292: checking if \$CC accepts -O3" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o3'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O3"
      cat > conftest.$ac_ext <<EOF
-#line 5296 "configure"
+#line 5298 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o3=yes
 else
@@ -5316,20 +5318,20 @@ if test "x${ac_cv_c_o3}" != "xno"; then
     CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
 else
     echo $ac_n "checking if \$CC accepts -O2""... $ac_c" 1>&6
-echo "configure:5320: checking if \$CC accepts -O2" >&5
+echo "configure:5322: checking if \$CC accepts -O2" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o2'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O2"
          cat > conftest.$ac_ext <<EOF
-#line 5326 "configure"
+#line 5328 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5333: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o2=yes
 else
@@ -5346,20 +5348,20 @@ echo "$ac_t""$ac_cv_c_o2" 1>&6
         CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
     else
         echo $ac_n "checking if \$CC accepts -O""... $ac_c" 1>&6
-echo "configure:5350: checking if \$CC accepts -O" >&5
+echo "configure:5352: checking if \$CC accepts -O" >&5
 if eval "test \"`echo '$''{'ac_cv_c_o'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -O"
              cat > conftest.$ac_ext <<EOF
-#line 5356 "configure"
+#line 5358 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5363: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_o=yes
 else
@@ -5379,20 +5381,20 @@ echo "$ac_t""$ac_cv_c_o" 1>&6
 fi
 
 echo $ac_n "checking if \$CC accepts -ffast-math""... $ac_c" 1>&6
-echo "configure:5383: checking if \$CC accepts -ffast-math" >&5
+echo "configure:5385: checking if \$CC accepts -ffast-math" >&5
 if eval "test \"`echo '$''{'ac_cv_c_fast_math'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -ffast-math"
      cat > conftest.$ac_ext <<EOF
-#line 5389 "configure"
+#line 5391 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5398: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_fast_math=yes
 else
@@ -5410,20 +5412,20 @@ if test "x${ac_cv_c_fast_math}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -funroll-loops""... $ac_c" 1>&6
-echo "configure:5414: checking if \$CC accepts -funroll-loops" >&5
+echo "configure:5416: checking if \$CC accepts -funroll-loops" >&5
 if eval "test \"`echo '$''{'ac_cv_c_unroll_loops'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -funroll-loops"
      cat > conftest.$ac_ext <<EOF
-#line 5420 "configure"
+#line 5422 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5427: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_unroll_loops=yes
 else
@@ -5441,20 +5443,20 @@ if test "x${ac_cv_c_unroll_loops}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -fomit-frame-pointer""... $ac_c" 1>&6
-echo "configure:5445: checking if \$CC accepts -fomit-frame-pointer" >&5
+echo "configure:5447: checking if \$CC accepts -fomit-frame-pointer" >&5
 if eval "test \"`echo '$''{'ac_cv_c_omit_frame_pointer'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
      cat > conftest.$ac_ext <<EOF
-#line 5451 "configure"
+#line 5453 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_omit_frame_pointer=yes
 else
@@ -5474,20 +5476,20 @@ if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -bundle -undefined error -lcc_dynamic""... $ac_c" 1>&6
-echo "configure:5478: checking if \$CC accepts -bundle -undefined error -lcc_dynamic" >&5
+echo "configure:5480: checking if \$CC accepts -bundle -undefined error -lcc_dynamic" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_darwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
      cat > conftest.$ac_ext <<EOF
-#line 5484 "configure"
+#line 5486 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5491: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_darwin=yes
 else
@@ -5505,20 +5507,20 @@ if test "x${ac_cv_ld_darwin}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
-echo "configure:5509: checking if \$CC accepts -shared" >&5
+echo "configure:5511: checking if \$CC accepts -shared" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -shared"
      cat > conftest.$ac_ext <<EOF
-#line 5515 "configure"
+#line 5517 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5524: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_plugins=yes
 else
@@ -5536,13 +5538,13 @@ if test "x${ac_cv_ld_plugins}" != "xno"; then
 fi
         
 echo $ac_n "checking for variadic cpp macros""... $ac_c" 1>&6
-echo "configure:5540: checking for variadic cpp macros" >&5
+echo "configure:5542: checking for variadic cpp macros" >&5
 if eval "test \"`echo '$''{'ac_cv_cpp_variadic_macros'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5546 "configure"
+#line 5548 "configure"
 #include "confdefs.h"
 #include <stdio.h>
           #define a(b,c...) printf(b,##c)
@@ -5550,7 +5552,7 @@ int main() {
 a("foo");a("%s","bar");a("%s%s","baz","quux");
 ; return 0; }
 EOF
-if { (eval echo configure:5554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cpp_variadic_macros=yes
 else
@@ -5571,7 +5573,7 @@ EOF
 fi
 
 echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
-echo "configure:5575: checking __attribute__ ((aligned ())) support" >&5
+echo "configure:5577: checking __attribute__ ((aligned ())) support" >&5
 if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5579,14 +5581,14 @@ else
         CFLAGS="${save_CFLAGS} -Werror"
     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
         cat > conftest.$ac_ext <<EOF
-#line 5583 "configure"
+#line 5585 "configure"
 #include "confdefs.h"
 
 int main() {
 static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;
 ; return 0; }
 EOF
-if { (eval echo configure:5590: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"
 else
@@ -5616,7 +5618,7 @@ case "x${target_cpu}" in
 esac
 
 BUILTINS="${BUILTINS}"
-PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
+PLUGINS="${PLUGINS} misc/dummy/dummy misc/null"
 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy"
 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
 PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/spdif codec/mpeg_audio/mpeg_audio"
@@ -5643,20 +5645,20 @@ then
 fi
 
 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:5647: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:5649: checking if \$CC groks MMX inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5653 "configure"
+#line 5655 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmx_inline=yes
 else
@@ -5674,20 +5676,20 @@ if test "x${ac_cv_mmx_inline}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6
-echo "configure:5678: checking if \$CC groks MMX EXT inline assembly" >&5
+echo "configure:5680: checking if \$CC groks MMX EXT inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5684 "configure"
+#line 5686 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5693: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmxext_inline=yes
 else
@@ -5705,20 +5707,20 @@ if test "x${ac_cv_mmxext_inline}" != "xno"; then
 fi
 
 echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6
-echo "configure:5709: checking if \$CC groks 3D Now! inline assembly" >&5
+echo "configure:5711: checking if \$CC groks 3D Now! inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5715 "configure"
+#line 5717 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5724: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_3dnow_inline=yes
 else
@@ -5740,20 +5742,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6
-echo "configure:5744: checking if \$CC groks SSE inline assembly" >&5
+echo "configure:5746: checking if \$CC groks SSE inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5750 "configure"
+#line 5752 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sse_inline=yes
 else
@@ -5778,20 +5780,20 @@ fi
 # we should be able to remove this test with future versions of mingw32
 if test "x${SYS}" != "xmingw32"; then
 echo $ac_n "checking if \$CC groks AltiVec inline assembly""... $ac_c" 1>&6
-echo "configure:5782: checking if \$CC groks AltiVec inline assembly" >&5
+echo "configure:5784: checking if \$CC groks AltiVec inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS}"
      cat > conftest.$ac_ext <<EOF
-#line 5788 "configure"
+#line 5790 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline=yes
 else
@@ -5800,14 +5802,14 @@ else
   rm -rf conftest*
   CFLAGS="${save_CFLAGS} -Wa,-m7400"
           cat > conftest.$ac_ext <<EOF
-#line 5804 "configure"
+#line 5806 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline="-Wa,-m7400"
 else
@@ -5838,21 +5840,21 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks AltiVec C extensions""... $ac_c" 1>&6
-echo "configure:5842: checking if \$CC groks AltiVec C extensions" >&5
+echo "configure:5844: checking if \$CC groks AltiVec C extensions" >&5
 if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -faltivec"
      # Darwin test
      cat > conftest.$ac_ext <<EOF
-#line 5849 "configure"
+#line 5851 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5856: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec=-faltivec
 else
@@ -5863,14 +5865,14 @@ else
         # Linux/PPC test
         CFLAGS="${save_CFLAGS} ${idctaltivec_CFLAGS} -fvec"
         cat > conftest.$ac_ext <<EOF
-#line 5867 "configure"
+#line 5869 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5874: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec="-fvec"
 else
@@ -5900,20 +5902,20 @@ EOF
 fi
 
 echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6
-echo "configure:5904: checking if linker needs -framework vecLib" >&5
+echo "configure:5906: checking if linker needs -framework vecLib" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   LDFLAGS="${vlc_LDFLAGS} -framework vecLib"
      cat > conftest.$ac_ext <<EOF
-#line 5910 "configure"
+#line 5912 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_altivec=yes
 else
@@ -6045,17 +6047,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6049: checking for $ac_hdr" >&5
+echo "configure:6051: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6054 "configure"
+#line 6056 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6086,7 +6088,7 @@ done
 
     else
       echo $ac_n "checking for libdvdcss.a in ${with_dvdcss_tree}""... $ac_c" 1>&6
-echo "configure:6090: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
+echo "configure:6092: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
       real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
       if test "x${real_dvdcss_tree}" = "x"
       then
@@ -6112,7 +6114,7 @@ echo "configure:6090: checking for libdvdcss.a in ${with_dvdcss_tree}" >&5
   ;;
   *)
     echo $ac_n "checking for dvdcss headers in ${with_dvdcss}""... $ac_c" 1>&6
-echo "configure:6116: checking for dvdcss headers in ${with_dvdcss}" >&5
+echo "configure:6118: checking for dvdcss headers in ${with_dvdcss}" >&5
     if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
     then
             echo "$ac_t""yes" 1>&6
@@ -6154,17 +6156,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6158: checking for $ac_hdr" >&5
+echo "configure:6160: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6163 "configure"
+#line 6165 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6170: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6186,14 +6188,14 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
      cat > conftest.$ac_ext <<EOF
-#line 6190 "configure"
+#line 6192 "configure"
 #include "confdefs.h"
 #include <dvdread/dvd_reader.h>
 int main() {
 int foo() { return DVD_VIDEO_LB_LEN; }
 ; return 0; }
 EOF
-if { (eval echo configure:6197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6199: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
           PLUGINS="${PLUGINS} access/dvdread/dvdread"
@@ -6258,17 +6260,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6262: checking for $ac_hdr" >&5
+echo "configure:6264: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6267 "configure"
+#line 6269 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6340,17 +6342,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6344: checking for $ac_hdr" >&5
+echo "configure:6346: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6349 "configure"
+#line 6351 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6379,7 +6381,7 @@ done
 
     else
       echo $ac_n "checking for libdvbpsi.a in ${with_dvbpsi_tree}""... $ac_c" 1>&6
-echo "configure:6383: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
+echo "configure:6385: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
       if test "x${real_dvbpsi_tree}" = "x"
       then
@@ -6402,7 +6404,7 @@ echo "configure:6383: checking for libdvbpsi.a in ${with_dvbpsi_tree}" >&5
       ;;
   *)
     echo $ac_n "checking for dvbpsi headers in ${with_dvbpsi}""... $ac_c" 1>&6
-echo "configure:6406: checking for dvbpsi headers in ${with_dvbpsi}" >&5
+echo "configure:6408: checking for dvbpsi headers in ${with_dvbpsi}" >&5
     if test "x${with_dvbpsi}" = "x"
     then
       test_LDFLAGS=""
@@ -6414,17 +6416,17 @@ echo "configure:6406: checking for dvbpsi headers in ${with_dvbpsi}" >&5
     CPPFLAGS="${save_CPPFLAGS} ${test_CFLAGS}"
     ac_safe=`echo "dvbpsi/dr.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dvbpsi/dr.h""... $ac_c" 1>&6
-echo "configure:6418: checking for dvbpsi/dr.h" >&5
+echo "configure:6420: checking for dvbpsi/dr.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6423 "configure"
+#line 6425 "configure"
 #include "confdefs.h"
 #include <dvbpsi/dr.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6428: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6472,17 +6474,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6476: checking for $ac_hdr" >&5
+echo "configure:6478: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6481 "configure"
+#line 6483 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6522,7 +6524,7 @@ fi
 if test "x${enable_vcd}" != "xno"
 then
   cat > conftest.$ac_ext <<EOF
-#line 6526 "configure"
+#line 6528 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -6537,7 +6539,7 @@ rm -f conftest*
 
   
   cat > conftest.$ac_ext <<EOF
-#line 6541 "configure"
+#line 6543 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -6581,12 +6583,12 @@ if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
 then
   have_ipv6=0
   echo $ac_n "checking for inet_pton""... $ac_c" 1>&6
-echo "configure:6585: checking for inet_pton" >&5
+echo "configure:6587: checking for inet_pton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_pton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6590 "configure"
+#line 6592 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_pton(); below.  */
@@ -6609,7 +6611,7 @@ inet_pton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6613: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_pton=yes"
 else
@@ -6628,7 +6630,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for inet_pton in -lresolv""... $ac_c" 1>&6
-echo "configure:6632: checking for inet_pton in -lresolv" >&5
+echo "configure:6634: checking for inet_pton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_pton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6636,7 +6638,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6640 "configure"
+#line 6642 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6647,7 +6649,7 @@ int main() {
 inet_pton()
 ; return 0; }
 EOF
-if { (eval echo configure:6651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6672,9 +6674,9 @@ fi
 fi
 
   echo $ac_n "checking for sockaddr_in6 in netinet/in.h""... $ac_c" 1>&6
-echo "configure:6676: checking for sockaddr_in6 in netinet/in.h" >&5
+echo "configure:6678: checking for sockaddr_in6 in netinet/in.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6678 "configure"
+#line 6680 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
@@ -6695,9 +6697,9 @@ fi
 if test "x${SYS}" = "xmingw32"
 then
   echo $ac_n "checking for getaddrinfo in ws2tcpip.h""... $ac_c" 1>&6
-echo "configure:6699: checking for getaddrinfo in ws2tcpip.h" >&5
+echo "configure:6701: checking for getaddrinfo in ws2tcpip.h" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6701 "configure"
+#line 6703 "configure"
 #include "confdefs.h"
 #include <ws2tcpip.h>
 EOF
@@ -6779,7 +6781,7 @@ fi
       { echo "configure: error: ${with_mad_tree} directory doesn't exist" 1>&2; exit 1; }
     fi
         echo $ac_n "checking for mad.h in ${real_mad_tree}/libmad""... $ac_c" 1>&6
-echo "configure:6783: checking for mad.h in ${real_mad_tree}/libmad" >&5
+echo "configure:6785: checking for mad.h in ${real_mad_tree}/libmad" >&5
     if test -f ${real_mad_tree}/libmad/mad.h
     then
       echo "$ac_t""yes" 1>&6
@@ -6787,7 +6789,7 @@ echo "configure:6783: checking for mad.h in ${real_mad_tree}/libmad" >&5
       mad_LDFLAGS="${mad_LDFLAGS} -L${real_mad_tree}/libmad/.libs"
       LDFLAGS="${save_LDFLAGS} ${mad_LDFLAGS}"
       echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6791: checking for mad_bit_init in -lmad" >&5
+echo "configure:6793: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6795,7 +6797,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6799 "configure"
+#line 6801 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6806,7 +6808,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6843,17 +6845,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6847: checking for $ac_hdr" >&5
+echo "configure:6849: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6852 "configure"
+#line 6854 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6881,7 +6883,7 @@ fi
 done
 
     echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6885: checking for mad_bit_init in -lmad" >&5
+echo "configure:6887: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6889,7 +6891,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6893 "configure"
+#line 6895 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6900,7 +6902,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6932,17 +6934,17 @@ for ac_hdr in id3tag.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6936: checking for $ac_hdr" >&5
+echo "configure:6938: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6941 "configure"
+#line 6943 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6946: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6948: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7008,7 +7010,7 @@ fi
   if test "x${with_ffmpeg_tree}" != "x"
   then
     echo $ac_n "checking for libavcodec.a in ${with_ffmpeg_tree}""... $ac_c" 1>&6
-echo "configure:7012: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
+echo "configure:7014: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
     if test "x${real_ffmpeg_tree}" = x
     then
@@ -7029,7 +7031,7 @@ echo "configure:7012: checking for libavcodec.a in ${with_ffmpeg_tree}" >&5
     CFLAGS="${save_CFLAGS} ${ffmpeg_CFLAGS}"
     LDFLAGS="${save_LDFLAGS} ${ffmpeg_LDFLAGS}"
     echo $ac_n "checking for avcodec_init in -lavcodec""... $ac_c" 1>&6
-echo "configure:7033: checking for avcodec_init in -lavcodec" >&5
+echo "configure:7035: checking for avcodec_init in -lavcodec" >&5
 ac_lib_var=`echo avcodec'_'avcodec_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7037,7 +7039,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lavcodec  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7041 "configure"
+#line 7043 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7048,7 +7050,7 @@ int main() {
 avcodec_init()
 ; return 0; }
 EOF
-if { (eval echo configure:7052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7106,7 +7108,7 @@ fi
   if test "x${with_faad_tree}" != "x"
   then
     echo $ac_n "checking for libfaad.a in ${with_faad_tree}""... $ac_c" 1>&6
-echo "configure:7110: checking for libfaad.a in ${with_faad_tree}" >&5
+echo "configure:7112: checking for libfaad.a in ${with_faad_tree}" >&5
     real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
     if test "x${real_faad_tree}" = x
     then
@@ -7130,17 +7132,17 @@ echo "configure:7110: checking for libfaad.a in ${with_faad_tree}" >&5
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7134: checking for $ac_hdr" >&5
+echo "configure:7136: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7139 "configure"
+#line 7141 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7144: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7168,7 +7170,7 @@ fi
 done
 
     echo $ac_n "checking for faacDecOpen in -lfaad""... $ac_c" 1>&6
-echo "configure:7172: checking for faacDecOpen in -lfaad" >&5
+echo "configure:7174: checking for faacDecOpen in -lfaad" >&5
 ac_lib_var=`echo faad'_'faacDecOpen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7176,7 +7178,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lfaad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7180 "configure"
+#line 7182 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7187,7 +7189,7 @@ int main() {
 faacDecOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:7191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7231,17 +7233,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7235: checking for $ac_hdr" >&5
+echo "configure:7237: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7240 "configure"
+#line 7242 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7245: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7298,7 +7300,7 @@ fi
       { echo "configure: error: ${with_a52_tree} directory doesn't exist" 1>&2; exit 1; }
     fi
         echo $ac_n "checking for a52.h in ${real_a52_tree}/include""... $ac_c" 1>&6
-echo "configure:7302: checking for a52.h in ${real_a52_tree}/include" >&5
+echo "configure:7304: checking for a52.h in ${real_a52_tree}/include" >&5
     if test -f ${real_a52_tree}/include/a52.h
     then
       echo "$ac_t""yes" 1>&6
@@ -7306,7 +7308,7 @@ echo "configure:7302: checking for a52.h in ${real_a52_tree}/include" >&5
       a52_LDFLAGS="${a52_LDFLAGS} -L${real_a52_tree}/liba52/.libs"
       LDFLAGS="${save_LDFLAGS} ${a52_LDFLAGS}"
       echo $ac_n "checking for a52_free in -la52""... $ac_c" 1>&6
-echo "configure:7310: checking for a52_free in -la52" >&5
+echo "configure:7312: checking for a52_free in -la52" >&5
 ac_lib_var=`echo a52'_'a52_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7314,7 +7316,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-la52 -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7318 "configure"
+#line 7320 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7325,7 +7327,7 @@ int main() {
 a52_free()
 ; return 0; }
 EOF
-if { (eval echo configure:7329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7379,17 +7381,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7383: checking for $ac_hdr" >&5
+echo "configure:7385: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7388 "configure"
+#line 7390 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7395: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7411,7 +7413,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
       echo $ac_n "checking for a52_free in -la52""... $ac_c" 1>&6
-echo "configure:7415: checking for a52_free in -la52" >&5
+echo "configure:7417: checking for a52_free in -la52" >&5
 ac_lib_var=`echo a52'_'a52_free | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7419,7 +7421,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-la52 -lm $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7423 "configure"
+#line 7425 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7430,7 +7432,7 @@ int main() {
 a52_free()
 ; return 0; }
 EOF
-if { (eval echo configure:7434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7494,17 +7496,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7498: checking for $ac_hdr" >&5
+echo "configure:7500: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7503 "configure"
+#line 7505 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7547,17 +7549,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7551: checking for $ac_hdr" >&5
+echo "configure:7553: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7556 "configure"
+#line 7558 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7609,17 +7611,17 @@ if test "x${enable_x11}" != "xno" &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7613: checking for $ac_hdr" >&5
+echo "configure:7615: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7618 "configure"
+#line 7620 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7665,17 +7667,17 @@ if test "x${enable_xvideo}" != "xno" &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7669: checking for $ac_hdr" >&5
+echo "configure:7671: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7674 "configure"
+#line 7676 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7698,7 +7700,7 @@ EOF
  
     CFLAGS="${save_CFLAGS} -L${x_libraries} -lX11 -lXext"
     echo $ac_n "checking for XvPutImage in -lXv_pic""... $ac_c" 1>&6
-echo "configure:7702: checking for XvPutImage in -lXv_pic" >&5
+echo "configure:7704: checking for XvPutImage in -lXv_pic" >&5
 ac_lib_var=`echo Xv_pic'_'XvPutImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7706,7 +7708,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv_pic  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7710 "configure"
+#line 7712 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7717,7 +7719,7 @@ int main() {
 XvPutImage()
 ; return 0; }
 EOF
-if { (eval echo configure:7721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7739,7 +7741,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for XvPutImage in -lXv""... $ac_c" 1>&6
-echo "configure:7743: checking for XvPutImage in -lXv" >&5
+echo "configure:7745: checking for XvPutImage in -lXv" >&5
 ac_lib_var=`echo Xv'_'XvPutImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -7747,7 +7749,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7751 "configure"
+#line 7753 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7758,7 +7760,7 @@ int main() {
 XvPutImage()
 ; return 0; }
 EOF
-if { (eval echo configure:7762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7818,7 +7820,7 @@ fi
   # Extract the first word of "sdl12-config", so it can be a program name with args.
 set dummy sdl12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7822: checking for $ac_word" >&5
+echo "configure:7824: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7858,7 +7860,7 @@ fi
     # Extract the first word of "sdl11-config", so it can be a program name with args.
 set dummy sdl11-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7862: checking for $ac_word" >&5
+echo "configure:7864: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7899,7 +7901,7 @@ fi
     # Extract the first word of "sdl-config", so it can be a program name with args.
 set dummy sdl-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7903: checking for $ac_word" >&5
+echo "configure:7905: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -7944,17 +7946,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7948: checking for $ac_hdr" >&5
+echo "configure:7950: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 7953 "configure"
+#line 7955 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8024,17 +8026,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8028: checking for $ac_hdr" >&5
+echo "configure:8030: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8033 "configure"
+#line 8035 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8063,7 +8065,7 @@ done
 
     else
       echo $ac_n "checking for directX headers in ${with_directx}""... $ac_c" 1>&6
-echo "configure:8067: checking for directX headers in ${with_directx}" >&5
+echo "configure:8069: checking for directX headers in ${with_directx}" >&5
       if test -f ${with_directx}/ddraw.h
       then
         PLUGINS="${PLUGINS} video_output/directx/directx"
@@ -8090,17 +8092,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8094: checking for $ac_hdr" >&5
+echo "configure:8096: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8099 "configure"
+#line 8101 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8195,17 +8197,17 @@ if test "x${enable_aa}" = "xyes"
 then
   ac_safe=`echo "aalib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for aalib.h""... $ac_c" 1>&6
-echo "configure:8199: checking for aalib.h" >&5
+echo "configure:8201: checking for aalib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8204 "configure"
+#line 8206 "configure"
 #include "confdefs.h"
 #include <aalib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8256,17 +8258,17 @@ then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8260: checking for $ac_hdr" >&5
+echo "configure:8262: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8265 "configure"
+#line 8267 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8270: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8272: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8289,7 +8291,7 @@ EOF
  
     PLUGINS="${PLUGINS} audio_output/oss"
     echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-echo "configure:8293: checking for main in -lossaudio" >&5
+echo "configure:8295: checking for main in -lossaudio" >&5
 ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8297,14 +8299,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lossaudio  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8301 "configure"
+#line 8303 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:8308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8340,7 +8342,7 @@ if test "${enable_esd+set}" = set; then
      # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8344: checking for $ac_word" >&5
+echo "configure:8346: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8391,7 +8393,7 @@ if test "${enable_arts+set}" = set; then
      # Extract the first word of "artsc-config", so it can be a program name with args.
 set dummy artsc-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8395: checking for $ac_word" >&5
+echo "configure:8397: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8441,17 +8443,17 @@ if test "${enable_alsa+set}" = set; then
    then
      ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
-echo "configure:8445: checking for alsa/asoundlib.h" >&5
+echo "configure:8447: checking for alsa/asoundlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8450 "configure"
+#line 8452 "configure"
 #include "confdefs.h"
 #include <alsa/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8457: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8468,7 +8470,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:8472: checking for main in -lasound" >&5
+echo "configure:8474: checking for main in -lasound" >&5
 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -8476,14 +8478,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 8480 "configure"
+#line 8482 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:8487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8565,7 +8567,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8569: checking for $ac_word" >&5
+echo "configure:8571: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8604,7 +8606,7 @@ fi
     # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8608: checking for $ac_word" >&5
+echo "configure:8610: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8644,8 +8646,8 @@ fi
     then
       { echo "configure: error: Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk." 1>&2; exit 1; }
     fi
-    gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
-    gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
+    gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
+    gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
     # now look for the gtk.h header
     CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
     ac_cv_gtk_headers=yes
@@ -8653,17 +8655,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8657: checking for $ac_hdr" >&5
+echo "configure:8659: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8662 "configure"
+#line 8664 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8669: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8695,6 +8697,7 @@ done
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
       PLUGINS="${PLUGINS} gui/gtk/gtk"
+      NEED_GTK_MAIN=yes
       ALIASES="${ALIASES} gvlc"
     fi
     CPPFLAGS="${save_CPPFLAGS}"
@@ -8723,7 +8726,7 @@ fi
   # Extract the first word of "gtk12-config", so it can be a program name with args.
 set dummy gtk12-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8727: checking for $ac_word" >&5
+echo "configure:8730: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK12_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8762,7 +8765,7 @@ fi
     # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8766: checking for $ac_word" >&5
+echo "configure:8769: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8802,8 +8805,8 @@ fi
     then
       { echo "configure: error: Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-familiar." 1>&2; exit 1; }
     fi
-    familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
-    familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
+    familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
+    familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
     # now look for the gtk.h header
     CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
     ac_cv_gtk_headers=yes
@@ -8811,17 +8814,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8815: checking for $ac_hdr" >&5
+echo "configure:8818: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8820 "configure"
+#line 8823 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8853,6 +8856,7 @@ done
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
       PLUGINS="${PLUGINS} gui/familiar/familiar"
+      NEED_GTK_MAIN=yes
     fi
     CPPFLAGS="${save_CPPFLAGS}"
   fi
@@ -8866,7 +8870,7 @@ if test "${enable_gnome+set}" = set; then
     # Extract the first word of "gnome-config", so it can be a program name with args.
 set dummy gnome-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:8870: checking for $ac_word" >&5
+echo "configure:8874: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -8910,17 +8914,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:8914: checking for $ac_hdr" >&5
+echo "configure:8918: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 8919 "configure"
+#line 8923 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8942,6 +8946,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
 EOF
  
       PLUGINS="${PLUGINS} gui/gtk/gnome"
+      NEED_GTK_MAIN=yes
       ALIASES="${ALIASES} gnome-vlc"
      
 else
@@ -9025,17 +9030,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9029: checking for $ac_hdr" >&5
+echo "configure:9034: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9034 "configure"
+#line 9039 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9078,17 +9083,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9082: checking for $ac_hdr" >&5
+echo "configure:9087: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9087 "configure"
+#line 9092 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9097: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9159,17 +9164,17 @@ if test "x${enable_xosd}" = "xyes"
 then
   ac_safe=`echo "xosd.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for xosd.h""... $ac_c" 1>&6
-echo "configure:9163: checking for xosd.h" >&5
+echo "configure:9168: checking for xosd.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9168 "configure"
+#line 9173 "configure"
 #include "confdefs.h"
 #include <xosd.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9178: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9192,14 +9197,14 @@ have_xosd="false"
 fi
 
   cat > conftest.$ac_ext <<EOF
-#line 9196 "configure"
+#line 9201 "configure"
 #include "confdefs.h"
 #include <xosd.h>
 int main() {
 void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }
 ; return 0; }
 EOF
-if { (eval echo configure:9203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:9208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   :
 else
   echo "configure: failed program was:" >&5
@@ -9228,17 +9233,17 @@ if test "x${enable_lirc}" = "xyes"
 then
   ac_safe=`echo "lirc/lirc_client.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lirc/lirc_client.h""... $ac_c" 1>&6
-echo "configure:9232: checking for lirc/lirc_client.h" >&5
+echo "configure:9237: checking for lirc/lirc_client.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 9237 "configure"
+#line 9242 "configure"
 #include "confdefs.h"
 #include <lirc/lirc_client.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9242: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9247: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9255,7 +9260,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for lirc_init in -llirc_client""... $ac_c" 1>&6
-echo "configure:9259: checking for lirc_init in -llirc_client" >&5
+echo "configure:9264: checking for lirc_init in -llirc_client" >&5
 ac_lib_var=`echo lirc_client'_'lirc_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9263,7 +9268,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-llirc_client  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9267 "configure"
+#line 9272 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9274,7 +9279,7 @@ int main() {
 lirc_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9329,7 +9334,7 @@ fi
       ;;
     *)
                   echo $ac_n "checking whether the byte order is big-endian""... $ac_c" 1>&6
-echo "configure:9333: checking whether the byte order is big-endian" >&5
+echo "configure:9338: checking whether the byte order is big-endian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9411,7 +9416,7 @@ if test "${enable_pth+set}" = set; then
   enableval="$enable_pth"
    if test "x${enable_pth}" = "xyes"; then
     echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
-echo "configure:9415: checking for pth_init in -lpth" >&5
+echo "configure:9420: checking for pth_init in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9419,7 +9424,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9423 "configure"
+#line 9428 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9430,7 +9435,7 @@ int main() {
 pth_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9458,7 +9463,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 9462 "configure"
+#line 9467 "configure"
 #include "confdefs.h"
 #include <pth.h>
 EOF
@@ -9484,7 +9489,7 @@ if test "${enable_st+set}" = set; then
   enableval="$enable_st"
    if test "x${enable_st}" = "xyes"; then
     echo $ac_n "checking for st_init in -lst""... $ac_c" 1>&6
-echo "configure:9488: checking for st_init in -lst" >&5
+echo "configure:9493: checking for st_init in -lst" >&5
 ac_lib_var=`echo st'_'st_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9492,7 +9497,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lst  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9496 "configure"
+#line 9501 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9503,7 +9508,7 @@ int main() {
 st_init()
 ; return 0; }
 EOF
-if { (eval echo configure:9507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9531,7 +9536,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 9535 "configure"
+#line 9540 "configure"
 #include "confdefs.h"
 #include <st.h>
 EOF
@@ -9567,7 +9572,7 @@ then
   # Extract the first word of "mozilla-config", so it can be a program name with args.
 set dummy mozilla-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9571: checking for $ac_word" >&5
+echo "configure:9576: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MOZILLA_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -9605,7 +9610,7 @@ fi
     if test "x${SYS}" != "xmingw32"; then
       LDFLAGS="${save_LDFLAGS} -L${x_libraries}"
       echo $ac_n "checking for XtStrings in -lXt""... $ac_c" 1>&6
-echo "configure:9609: checking for XtStrings in -lXt" >&5
+echo "configure:9614: checking for XtStrings in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtStrings | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -9613,7 +9618,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lXt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 9617 "configure"
+#line 9622 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9624,7 +9629,7 @@ int main() {
 XtStrings()
 ; return 0; }
 EOF
-if { (eval echo configure:9628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9654,6 +9659,13 @@ fi
   fi
 fi
 
+if test "x${NEED_GTK_MAIN}" != "xno"
+then
+    PLUGINS="${PLUGINS} misc/gtk_main"
+    gtk_main_CFLAGS="${gtk_main_CFLAGS} ${gtk_CFLAGS} ${familiar_CFLAGS} ${gnome_CFLAGS}"
+    gtk_main_LDFLAGS="${gtk_main_LDFLAGS} ${gtk_LDFLAGS} ${familiar_LDFLAGS} ${gnome_LDFLAGS}"
+fi
+
 # Check whether --enable-plugins or --disable-plugins was given.
 if test "${enable_plugins+set}" = set; then
   enableval="$enable_plugins"
@@ -9817,6 +9829,8 @@ for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc
 
 
 
+
+
 
 
 
@@ -10051,6 +10065,7 @@ s%@ffmpeg_CFLAGS@%$ffmpeg_CFLAGS%g
 s%@glide_CFLAGS@%$glide_CFLAGS%g
 s%@gnome_CFLAGS@%$gnome_CFLAGS%g
 s%@gtk_CFLAGS@%$gtk_CFLAGS%g
+s%@gtk_main_CFLAGS@%$gtk_main_CFLAGS%g
 s%@kde_CFLAGS@%$kde_CFLAGS%g
 s%@idctaltivec_CFLAGS@%$idctaltivec_CFLAGS%g
 s%@macosx_CFLAGS@%$macosx_CFLAGS%g
@@ -10089,6 +10104,7 @@ s%@ggi_LDFLAGS@%$ggi_LDFLAGS%g
 s%@glide_LDFLAGS@%$glide_LDFLAGS%g
 s%@gnome_LDFLAGS@%$gnome_LDFLAGS%g
 s%@gtk_LDFLAGS@%$gtk_LDFLAGS%g
+s%@gtk_main_LDFLAGS@%$gtk_main_LDFLAGS%g
 s%@http_LDFLAGS@%$http_LDFLAGS%g
 s%@idctaltivec_LDFLAGS@%$idctaltivec_LDFLAGS%g
 s%@imdct_LDFLAGS@%$imdct_LDFLAGS%g
index 23370e10fc9b97f34271987452a8c0ee1e8e4e13..7ef0968d254b9aa2c0dbb045ed56c46e9aa49e95 100644 (file)
@@ -260,6 +260,9 @@ if test "x${x_libraries}" = "xNONE"; then
   x_libraries="/usr/X11R6/lib"
 fi
 
+dnl Build the gtk_main plugin?
+NEED_GTK_MAIN=no
+
 dnl Check for DPMS
 if test "x${SYS}" != "xmingw32"
 then
@@ -437,7 +440,7 @@ dnl
 dnl  default modules
 dnl
 BUILTINS="${BUILTINS}"
-PLUGINS="${PLUGINS} misc/dummy/dummy misc/null/null"
+PLUGINS="${PLUGINS} misc/dummy/dummy misc/null"
 PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy"
 PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts"
 PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/spdif codec/mpeg_audio/mpeg_audio"
@@ -1594,8 +1597,8 @@ then
     then
       AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
     fi
-    gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
-    gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
+    gtk_CFLAGS="${gtk_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
+    gtk_LDFLAGS="${gtk_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
     # now look for the gtk.h header
     CPPFLAGS="${save_CPPFLAGS} ${gtk_CFLAGS}"
     ac_cv_gtk_headers=yes
@@ -1606,6 +1609,7 @@ then
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
       PLUGINS="${PLUGINS} gui/gtk/gtk"
+      NEED_GTK_MAIN=yes
       ALIASES="${ALIASES} gvlc"
     fi
     CPPFLAGS="${save_CPPFLAGS}"
@@ -1639,8 +1643,8 @@ then
     then
       AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-familiar.])
     fi
-    familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk`"
-    familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
+    familiar_CFLAGS="${familiar_CFLAGS} `${GTK_CONFIG} --cflags gtk gthread`"
+    familiar_LDFLAGS="${familiar_LDFLAGS} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
     # now look for the gtk.h header
     CPPFLAGS="${save_CPPFLAGS} ${familiar_CFLAGS}"
     ac_cv_gtk_headers=yes
@@ -1651,6 +1655,7 @@ then
     if test "x${ac_cv_gtk_headers}" = "xyes"
     then
       PLUGINS="${PLUGINS} gui/familiar/familiar"
+      NEED_GTK_MAIN=yes
     fi
     CPPFLAGS="${save_CPPFLAGS}"
   fi
@@ -1673,6 +1678,7 @@ AC_ARG_ENABLE(gnome,
     CPPFLAGS="${save_CPPFLAGS} ${gnome_CFLAGS}"
     AC_CHECK_HEADERS(gnome.h, [
       PLUGINS="${PLUGINS} gui/gtk/gnome"
+      NEED_GTK_MAIN=yes
       ALIASES="${ALIASES} gnome-vlc"
      ],[
       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
@@ -1966,6 +1972,16 @@ then
   fi
 fi
 
+dnl
+dnl  gtk_main plugin
+dnl
+if test "x${NEED_GTK_MAIN}" != "xno"
+then
+    PLUGINS="${PLUGINS} misc/gtk_main"
+    gtk_main_CFLAGS="${gtk_main_CFLAGS} ${gtk_CFLAGS} ${familiar_CFLAGS} ${gnome_CFLAGS}"
+    gtk_main_LDFLAGS="${gtk_main_LDFLAGS} ${gtk_LDFLAGS} ${familiar_LDFLAGS} ${gnome_LDFLAGS}"
+fi
+
 dnl
 dnl  Plug-ins - this must be AT THE END
 dnl
@@ -2064,6 +2080,7 @@ AC_SUBST(ffmpeg_CFLAGS)
 AC_SUBST(glide_CFLAGS)
 AC_SUBST(gnome_CFLAGS)
 AC_SUBST(gtk_CFLAGS)
+AC_SUBST(gtk_main_CFLAGS)
 AC_SUBST(kde_CFLAGS)
 AC_SUBST(idctaltivec_CFLAGS)
 AC_SUBST(macosx_CFLAGS)
@@ -2104,6 +2121,7 @@ AC_SUBST(ggi_LDFLAGS)
 AC_SUBST(glide_LDFLAGS)
 AC_SUBST(gnome_LDFLAGS)
 AC_SUBST(gtk_LDFLAGS)
+AC_SUBST(gtk_main_LDFLAGS)
 AC_SUBST(http_LDFLAGS)
 AC_SUBST(idctaltivec_LDFLAGS)
 AC_SUBST(imdct_LDFLAGS)
index 1298d979cad9ca15ddd35286cf1d4c4e8fb76948..8ba9f81673f7aa973dc7f5e1b5d5cdeb1e46a0a9 100755 (executable)
@@ -11,7 +11,7 @@ export DH_COMPAT=3
 # Compilation options
 export FFMPEG_VERSION=cvs
 export FAAD_VERSION=cvs
-export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4 --enable-dvb --enable-dv --enable-faad --with-faad-tree=faad-$(FAAD_VERSION)"
+export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-familiar --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4 --enable-dvb --enable-dv --enable-faad --with-faad-tree=faad-$(FAAD_VERSION)"
 # Remove --without-dvdcss here in non-totalitarian countries
 export DVDCSS_FLAGS="--enable-dvd --without-dvdcss"
 
@@ -78,7 +78,7 @@ install: build
        # Package: gnome-vlc
        mv debian/vlc/usr/bin/gnome-vlc debian/gnome-vlc/usr/bin/
        ln -s vlc debian/gnome-vlc/usr/share/doc/gnome-vlc
-       -mv debian/vlc/usr/lib/vlc/gui/gnome.so debian/gnome-vlc/usr/lib/vlc/gui/
+       mv debian/vlc/usr/lib/vlc/gui/gnome.so debian/gnome-vlc/usr/lib/vlc/gui/
        ln -s vlc.1.gz debian/gnome-vlc/usr/share/man/man1/gnome-vlc.1.gz
        mv debian/vlc/$(VIDDIR)/gnome-vlc32x32.xpm debian/gnome-vlc/$(VIDDIR)/gnome-vlc.xpm
        mv debian/vlc/$(VIDDIR)/gnome-vlc48x48.png debian/gnome-vlc/$(PIXDIR)/gnome-vlc.png
@@ -86,71 +86,72 @@ install: build
        # Package: gvlc
        mv debian/vlc/usr/bin/gvlc debian/gvlc/usr/bin/
        ln -s vlc debian/gvlc/usr/share/doc/gvlc
-       -mv debian/vlc/usr/lib/vlc/gui/gtk.so debian/gvlc/usr/lib/vlc/gui/
+       mv debian/vlc/usr/lib/vlc/gui/gtk.so debian/gvlc/usr/lib/vlc/gui/
+       mv debian/vlc/usr/lib/vlc/gui/familiar.so debian/gvlc/usr/lib/vlc/gui/
        ln -s vlc.1.gz debian/gvlc/usr/share/man/man1/gvlc.1.gz
        mv debian/vlc/$(VIDDIR)/gvlc32x32.xpm debian/gvlc/$(VIDDIR)/gvlc.xpm
        mv debian/vlc/$(VIDDIR)/gvlc48x48.png debian/gvlc/$(PIXDIR)/gvlc.png
 
        # Package: vlc-plugin-esd
        ln -s vlc debian/vlc-plugin-esd/usr/share/doc/vlc-plugin-esd
-       -mv debian/vlc/usr/lib/vlc/audio_output/esd.so \
+       mv debian/vlc/usr/lib/vlc/audio_output/esd.so \
                debian/vlc-plugin-esd/usr/lib/vlc/audio_output/
 
        # Package: vlc-plugin-alsa
        ln -s vlc debian/vlc-plugin-alsa/usr/share/doc/vlc-plugin-alsa
-       -mv debian/vlc/usr/lib/vlc/audio_output/alsa.so \
+       mv debian/vlc/usr/lib/vlc/audio_output/alsa.so \
                debian/vlc-plugin-alsa/usr/lib/vlc/audio_output/
 
        # Package: vlc-plugin-sdl
        ln -s vlc debian/vlc-plugin-sdl/usr/share/doc/vlc-plugin-sdl
-       -mv debian/vlc/usr/lib/vlc/audio_output/sdl.so \
+       mv debian/vlc/usr/lib/vlc/audio_output/sdl.so \
                debian/vlc-plugin-sdl/usr/lib/vlc/audio_output/
-       -mv debian/vlc/usr/lib/vlc/video_output/sdl.so \
+       mv debian/vlc/usr/lib/vlc/video_output/sdl.so \
                debian/vlc-plugin-sdl/usr/lib/vlc/video_output/
 
        # Package: vlc-plugin-ggi
        ln -s vlc debian/vlc-plugin-ggi/usr/share/doc/vlc-plugin-ggi
-       -mv debian/vlc/usr/lib/vlc/video_output/ggi.so \
+       mv debian/vlc/usr/lib/vlc/video_output/ggi.so \
                debian/vlc-plugin-ggi/usr/lib/vlc/video_output/
 
        # Package: vlc-plugin-glide
 ifeq ($(DEB_BUILD_ARCH),i386)
        ln -s vlc debian/vlc-plugin-glide/usr/share/doc/vlc-plugin-glide
-       -mv debian/vlc/usr/lib/vlc/video_output/glide.so \
+       mv debian/vlc/usr/lib/vlc/video_output/glide.so \
                debian/vlc-plugin-glide/usr/lib/vlc/video_output/
 endif
 
        # Package: qvlc
        mv debian/vlc/usr/bin/qvlc debian/qvlc/usr/bin/
        ln -s vlc debian/qvlc/usr/share/doc/qvlc
-       -mv debian/vlc/usr/lib/vlc/gui/qt.so debian/qvlc/usr/lib/vlc/gui/
+       mv debian/vlc/usr/lib/vlc/gui/qt.so debian/qvlc/usr/lib/vlc/gui/
        ln -s vlc.1.gz debian/qvlc/usr/share/man/man1/qvlc.1.gz
        mv debian/vlc/$(VIDDIR)/qvlc32x32.xpm debian/qvlc/$(VIDDIR)/qvlc.xpm
        mv debian/vlc/$(VIDDIR)/qvlc48x48.png debian/qvlc/$(PIXDIR)/qvlc.png
 
        # Package: vlc-plugin-mad
        ln -s vlc debian/vlc-plugin-mad/usr/share/doc/vlc-plugin-mad
-       -mv debian/vlc/usr/lib/vlc/codec/mad.so \
+       mv debian/vlc/usr/lib/vlc/codec/mad.so \
                debian/vlc-plugin-mad/usr/lib/vlc/codec/
 
        # Package: vlc-plugin-arts
        ln -s vlc debian/vlc-plugin-arts/usr/share/doc/vlc-plugin-arts
-       -mv debian/vlc/usr/lib/vlc/audio_output/arts.so \
+       mv debian/vlc/usr/lib/vlc/audio_output/arts.so \
                debian/vlc-plugin-arts/usr/lib/vlc/audio_output/
 
        # Package: vlc-plugin-lirc
        ln -s vlc debian/vlc-plugin-lirc/usr/share/doc/vlc-plugin-lirc
-       -mv debian/vlc/usr/lib/vlc/control/lirc.so \
+       mv debian/vlc/usr/lib/vlc/control/lirc.so \
                debian/vlc-plugin-lirc/usr/lib/vlc/control/
 
        # Package: vlc-plugin-aa
        ln -s vlc debian/vlc-plugin-aa/usr/share/doc/vlc-plugin-aa
-       -mv debian/vlc/usr/lib/vlc/video_output/aa.so \
+       mv debian/vlc/usr/lib/vlc/video_output/aa.so \
                debian/vlc-plugin-aa/usr/lib/vlc/video_output/
 
        # Package: vlc-plugin-xosd
        ln -s vlc debian/vlc-plugin-xosd/usr/share/doc/vlc-plugin-xosd
-       -mv debian/vlc/usr/lib/vlc/visualization/xosd.so \
+       mv debian/vlc/usr/lib/vlc/visualization/xosd.so \
                debian/vlc-plugin-xosd/usr/lib/vlc/visualization/
 
        # Package: mozilla-plugin-vlc
@@ -160,7 +161,7 @@ endif
        # Package: kvlc
        mv debian/vlc/usr/bin/kvlc debian/kvlc/usr/bin/
        ln -s vlc debian/kvlc/usr/share/doc/kvlc
-       -mv debian/vlc/usr/lib/vlc/gui/kde.so debian/kvlc/usr/lib/vlc/gui/
+       mv debian/vlc/usr/lib/vlc/gui/kde.so debian/kvlc/usr/lib/vlc/gui/
        ln -s vlc.1.gz debian/kvlc/usr/share/man/man1/kvlc.1.gz
        mv debian/vlc/$(VIDDIR)/kvlc32x32.xpm debian/kvlc/$(VIDDIR)/kvlc.xpm
        mv debian/vlc/$(VIDDIR)/kvlc48x48.png debian/kvlc/$(PIXDIR)/kvlc.png
index ea5fb9458d1f837467589ad77b06851f6f836b30..e6a3327b0adadda4c9b8dc9f8e8654f08f8c042e 100644 (file)
@@ -3,7 +3,7 @@
  * Declaration and extern access to global program object.
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
- * $Id: main.h,v 1.44 2002/08/12 09:34:15 sam Exp $
+ * $Id: main.h,v 1.45 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -38,6 +38,7 @@ struct vlc_t
 
     /* The vlc structure status */
     int                    i_status;
+    int                    i_instance;                   /* p_vlc instance # */
 
     /* Global properties */
     int                    i_argc;           /* command line arguments count */
@@ -72,7 +73,6 @@ struct vlc_t
     vlc_mutex_t            structure_lock;        /* lock for the p_vlc tree */
 
     /* Object structure data */
-    int                    i_unique;                    /* p_vlc occurence # */
     int                    i_counter;                      /* object counter */
     int                    i_objects;              /* Attached objects count */
     vlc_object_t **        pp_objects;               /* Array of all objects */
index 7ac8861bd89cba50b5de117d0ee5d844f61f08fe..dbe4a7e9060d56ee2b5603a2fd8469836ec35201 100644 (file)
@@ -2,7 +2,7 @@
  * vlc.h: global header for vlc
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc.h,v 1.9 2002/08/19 11:13:44 sam Exp $
+ * $Id: vlc.h,v 1.10 2002/08/20 18:08:51 sam 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
@@ -41,10 +41,12 @@ typedef int        vlc_status_t;
  * Error values
  *****************************************************************************/
 #define VLC_SUCCESS         -0                                   /* No error */
-#define VLC_EGENERIC        -1                              /* Generic error */
-#define VLC_ENOMEM          -2                          /* Not enough memory */
+#define VLC_ENOMEM          -1                          /* Not enough memory */
+#define VLC_EMODULE         -2                           /* Module not found */
 #define VLC_ESTATUS         -3                             /* Invalid status */
+#define VLC_ETHREAD         -4                     /* Could not spawn thread */
 #define VLC_EEXIT         -255                             /* Program exited */
+#define VLC_EGENERIC      -666                              /* Generic error */
 
 /*****************************************************************************
  * Booleans
@@ -115,10 +117,9 @@ vlc_error_t     vlc_create       ( void );
 vlc_error_t     vlc_init         ( int, char *[] );
 vlc_error_t     vlc_run          ( void );
 vlc_error_t     vlc_die          ( void );
-vlc_error_t     vlc_stop         ( void );
-vlc_error_t     vlc_end          ( void );
 vlc_error_t     vlc_destroy      ( void );
 
+vlc_error_t     vlc_set          ( const char *, const char * );
 vlc_error_t     vlc_add_intf     ( const char *, vlc_bool_t );
 vlc_error_t     vlc_add_target   ( const char *, int, int );
 
@@ -131,10 +132,9 @@ vlc_t *         vlc_create_r     ( void );
 vlc_error_t     vlc_init_r       ( vlc_t *, int, char *[] );
 vlc_error_t     vlc_run_r        ( vlc_t * );
 vlc_error_t     vlc_die_r        ( vlc_t * );
-vlc_error_t     vlc_stop_r       ( vlc_t * );
-vlc_error_t     vlc_end_r        ( vlc_t * );
 vlc_error_t     vlc_destroy_r    ( vlc_t * );
 
+vlc_error_t     vlc_set_r        ( vlc_t *, const char *, const char * );
 vlc_error_t     vlc_add_intf_r   ( vlc_t *, const char *, vlc_bool_t );
 vlc_error_t     vlc_add_target_r ( vlc_t *, const char *, int, int );
 
index 87e0fc5125ee7635b58618569eba1f94a4157385..075a55389eab46080b507a7c8b7eafa8a5d1095b 100644 (file)
@@ -2,7 +2,7 @@
  * rc.c : remote control stdin/stdout plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.3 2002/08/14 08:17:24 sam Exp $
+ * $Id: rc.c,v 1.4 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
  *
@@ -30,6 +30,7 @@
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdio.h>
 #include <ctype.h>
+#include <signal.h>
 
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
@@ -59,7 +60,12 @@ static void Run          ( intf_thread_t *p_intf );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
+#define POS_TEXT N_("show stream position")
+#define POS_LONGTEXT N_("Show the current position in seconds within the stream from time to time.")
+
 vlc_module_begin();
+    add_category_hint( N_("Remote control"), NULL );
+    add_bool( "rc-show-pos", 0, NULL, POS_TEXT, POS_LONGTEXT );
     set_description( _("remote control interface module") );
     set_capability( "interface", 20 );
     set_callbacks( Activate, NULL );
@@ -107,9 +113,11 @@ static int Activate( vlc_object_t *p_this )
 static void Run( intf_thread_t *p_intf )
 {
     input_thread_t * p_input;
+    playlist_t *     p_playlist;
 
     char       p_buffer[ MAX_LINE_LENGTH + 1 ];
     vlc_bool_t b_complete = 0;
+    vlc_bool_t b_showpos = config_GetInt( p_intf, "rc-show-pos" );
     input_info_category_t * p_category;
     input_info_t * p_info;
 
@@ -120,12 +128,9 @@ static void Run( intf_thread_t *p_intf )
     struct timeval tv;                                   /* how long to wait */
 
     double     f_ratio = 1;
-    char       psz_dashes[81];
 
-    memset(psz_dashes, '-', 80);
-    psz_dashes[80] = '\0';
-    
     p_input = NULL;
+    p_playlist = NULL;
 
     while( !p_intf->b_die )
     {
@@ -163,8 +168,21 @@ static void Run( intf_thread_t *p_intf )
         /* Manage the input part */
         if( p_input == NULL )
         {
-            p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
-                                               FIND_ANYWHERE );
+            if( p_playlist )
+            {
+                p_input = vlc_object_find( p_playlist, VLC_OBJECT_INPUT,
+                                                       FIND_CHILD );
+            }
+            else
+            {
+                p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+                                                   FIND_ANYWHERE );
+                if( p_input )
+                {
+                    p_playlist = vlc_object_find( p_input, VLC_OBJECT_PLAYLIST,
+                                                           FIND_PARENT );
+                }
+            }
         }
         else if( p_input->b_dead )
         {
@@ -172,7 +190,7 @@ static void Run( intf_thread_t *p_intf )
             p_input = NULL;
         }
 
-        if( p_input )
+        if( p_input && b_showpos )
         {
             /* Get position */
             vlc_mutex_lock( &p_input->stream.stream_lock );
@@ -197,40 +215,114 @@ static void Run( intf_thread_t *p_intf )
         if( b_complete == 1 )
         {
             char *p_cmd = p_buffer;
+            //char *p_tmp;
 
-            switch( p_cmd[0] )
+            if( !strcmp( p_cmd, "quit" ) )
             {
-            case 'a':
-            case 'A':
-                if( p_cmd[1] == ' ' )
+                p_intf->p_vlc->b_die = VLC_TRUE;
+            }
+            else if( !strcmp( p_cmd, "segfault" ) )
+            {
+                raise( SIGSEGV );
+            }
+            else if( !strcmp( p_cmd, "prev" ) )
+            {
+                if( p_playlist ) playlist_Prev( p_playlist );
+            }
+            else if( !strcmp( p_cmd, "next" ) )
+            {
+                if( p_playlist ) playlist_Next( p_playlist );
+            }
+            else if( !strcmp( p_cmd, "play" ) )
+            {
+                if( p_playlist ) playlist_Play( p_playlist );
+            }
+            else if( !strcmp( p_cmd, "stop" ) )
+            {
+                if( p_playlist ) playlist_Stop( p_playlist );
+            }
+            else if( !strcmp( p_cmd, "pause" ) )
+            {
+                if( p_input ) input_SetStatus( p_input, INPUT_STATUS_PAUSE );
+            }
+            else if( !strcmp( p_cmd, "tree" ) )
+            {
+                vlc_dumpstructure( p_intf->p_vlc );
+            }
+            else if( !strcmp( p_cmd, "list" ) )
+            {
+                vlc_liststructure( p_intf->p_vlc );
+            }
+            else if( !strncmp( p_cmd, "set ", 4 ) )
+            {
+#if 0
+//                vlc_set_r( p_intf->p_vlc, p_cmd + 4, strstr( p_cmd + 4, " " ) );
+                p_tmp = strstr( p_cmd + 4, " " );
+                p_tmp[0] = '\0';
+                config_PutPsz( p_intf->p_vlc, p_cmd + 4, p_tmp + 1 );
+                config_PutInt( p_intf->p_vlc, p_cmd + 4, atoi(p_tmp + 1) );
+#endif
+            }
+            else if( !strncmp( p_cmd, "intf ", 5 ) )
+            {
+                intf_thread_t *p_newintf;
+                char *psz_oldmodule = config_GetPsz( p_intf->p_vlc, "intf" );
+
+                config_PutPsz( p_intf->p_vlc, "intf", p_cmd + 5 );
+                p_newintf = intf_Create( p_intf->p_vlc );
+                config_PutPsz( p_intf->p_vlc, "intf", psz_oldmodule );
+
+                if( psz_oldmodule )
+                {
+                    free( psz_oldmodule );
+                }
+
+                if( p_newintf )
                 {
-                    playlist_t *p_playlist;
-                    p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
-                                                          FIND_ANYWHERE );
-                    if( p_playlist )
+                    p_newintf->b_block = VLC_FALSE;
+                    if( intf_RunThread( p_newintf ) )
                     {
-                        playlist_Add( p_playlist, p_cmd + 2,
-                                PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
-                        vlc_object_release( p_playlist );
+                        vlc_object_detach( p_newintf );
+                        intf_Destroy( p_newintf );
                     }
                 }
-                break;
-
-            case 'l':
-            case 'L':
-                vlc_liststructure( p_intf->p_vlc );
-                break;
-
-            case 'd':
-            case 'D':
-                vlc_dumpstructure( p_intf->p_vlc );
-                break;
-
-            case 'p':
-            case 'P':
-                if( p_input )
+            }
+            else if( !strcmp( p_cmd, "info" ) )
+            {
+                if ( p_input )
                 {
-                    input_SetStatus( p_input, INPUT_STATUS_PAUSE );
+                    vlc_mutex_lock( &p_input->stream.stream_lock );
+                    p_category = p_input->stream.p_info;
+                    while ( p_category )
+                    {
+                        printf( "+----[ %s ]\n", p_category->psz_name );
+                        printf( "| \n" );
+                        p_info = p_category->p_info;
+                        while ( p_info )
+                        {
+                            printf( "| %s: %s\n", p_info->psz_name,
+                                    p_info->psz_value );
+                            p_info = p_info->p_next;
+                        }
+                        p_category = p_category->p_next;
+                        printf( "| \n" );
+                    }
+                    printf( "+----[ end of stream info ]\n" );
+                    vlc_mutex_unlock( &p_input->stream.stream_lock );
+                }
+                else
+                {
+                    printf( "no input\n" );
+                }
+            }
+            else switch( p_cmd[0] )
+            {
+            case 'a':
+            case 'A':
+                if( p_cmd[1] == ' ' && p_playlist )
+                {
+                    playlist_Add( p_playlist, p_cmd + 2,
+                                  PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
                 }
                 break;
 
@@ -255,11 +347,6 @@ static void Run( intf_thread_t *p_intf )
                 ;
                 break;
 
-            case 'q':
-            case 'Q':
-                p_intf->p_vlc->b_die = VLC_TRUE;
-                break;
-
             case 'r':
             case 'R':
                 if( p_input )
@@ -282,50 +369,29 @@ static void Run( intf_thread_t *p_intf )
             case '?':
             case 'h':
             case 'H':
-                printf( "help for remote control commands\n" );
-                printf( "h . . . . . . . . . . . . . . . . . . . . . help\n" );
-                printf( "a XYZ . . . . . . . . . . append XYZ to playlist\n" );
-                printf( "p . . . . . . . . . . . . . . . . . toggle pause\n" );
-                printf( "f . . . . . . . . . . . . . . toggle  fullscreen\n" );
-                printf( "r X . . . seek in seconds,  for instance `r 3.5'\n" );
-                printf( "q . . . . . . . . . . . . . . . . . . . . . quit\n" );
-                printf( "end of help\n" );
-                break;
-            case 'i':
-            case 'I':
-                if ( p_input ) {
-                    printf( "Dumping stream info\n" );
-                    vlc_mutex_lock( &p_input->stream.stream_lock );
-                    p_category = p_input->stream.p_info;
-                    while ( p_category )
-                    {
-                        psz_dashes[72 - strlen(p_category->psz_name) ] = '\0';
-                        printf( "+--| %s |%s+\n", p_category->psz_name, psz_dashes);
-                        psz_dashes[72 - strlen(p_category->psz_name) ] = '-';
-                        p_info = p_category->p_info;
-                        while ( p_info )
-                        {
-                            printf( "| %s: %s\n", p_info->psz_name,
-                                    p_info->psz_value );
-                            p_info = p_info->p_next;
-                        }
-                        printf("|\n");
-                        p_category = p_category->p_next;
-                    }
-                    psz_dashes[78] = '\0';
-                    printf( "+%s+\n", psz_dashes );
-                    vlc_mutex_unlock( &p_input->stream.stream_lock );
-                }
-                else
-                {
-                    printf( "no input" );
-                }
+                printf("+----[ remote control commands ]\n");
+                printf("| \n");
+                printf("| a XYZ  . . . . . . . . . . . add XYZ to playlist\n");
+                printf("| play . . . . . . . . . . . . . . . . play stream\n");
+                printf("| stop . . . . . . . . . . . . . . . . stop stream\n");
+                printf("| next . . . . . . . . . . . .  next playlist item\n");
+                printf("| prev . . . . . . . . . .  previous playlist item\n");
+                printf("| \n");
+                printf("| r X  . . . seek in seconds, for instance `r 3.5'\n");
+                printf("| pause  . . . . . . . . . . . . . .  toggle pause\n");
+                printf("| f  . . . . . . . . . . . . . . toggle fullscreen\n");
+                printf("| info . . .  information about the current stream\n");
+                printf("| \n");
+                printf("| help . . . . . . . . . . . . . this help message\n");
+                printf("| quit . . . . . . . . . . . . . . . . .  quit vlc\n");
+                printf("| \n");
+                printf("+----[ end of help ]\n");
                 break;
             case '\0':
                 /* Ignore empty lines */
                 break;
             default:
-                printf( "unknown command `%s'\n", p_cmd );
+                printf( "unknown command `%s', type `help' for help\n", p_cmd );
                 break;
             }
         }
@@ -337,6 +403,12 @@ static void Run( intf_thread_t *p_intf )
     {
         vlc_object_release( p_input );
         p_input = NULL;
+
+        if( p_playlist )
+        {
+            vlc_object_release( p_playlist );
+            p_playlist = NULL;
+        }
     }
 }
 
index cd88757666ad693eb5a79fa1ab9d17121dad2a66..9b395a6e020d8774b2baee469c1f82483d379289 100644 (file)
@@ -2,7 +2,7 @@
  * familiar.c : familiar plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: familiar.c,v 1.5 2002/08/20 12:32:01 sam Exp $
+ * $Id: familiar.c,v 1.6 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
 #include "support.h"
 #include "familiar.h"
 
-/*****************************************************************************
- * Local variables (mutex-protected).
- *****************************************************************************/
-static void ** pp_global_data = NULL;
-
-/*****************************************************************************
- * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
- *****************************************************************************
- * gtk_init() makes several calls to g_atexit() which calls atexit() to
- * register tidying callbacks to be called at program exit. Since the Gtk+
- * plugin is likely to be unloaded at program exit, we have to export this
- * symbol to intercept the g_atexit() calls. Talk about crude hack.
- *****************************************************************************/
-void g_atexit( GVoidFunc func )
-{
-    intf_thread_t *p_intf;
-
-    int i_dummy;
-
-    if( pp_global_data == NULL )
-    {
-        atexit( func );
-        return;
-    }
-
-    p_intf = (intf_thread_t *)*pp_global_data;
-    if( p_intf == NULL )
-    {
-        return;
-    }
-
-    for( i_dummy = 0;
-         i_dummy < MAX_ATEXIT && p_intf->p_sys->pf_callback[i_dummy] != NULL;
-         i_dummy++ )
-    {
-        ;
-    }
-
-    if( i_dummy >= MAX_ATEXIT - 1 )
-    {
-        msg_Err( p_intf, "too many atexit() callbacks to register" );
-        return;
-    }
-
-    p_intf->p_sys->pf_callback[i_dummy]     = func;
-    p_intf->p_sys->pf_callback[i_dummy + 1] = NULL;
-}
-
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
@@ -94,7 +46,6 @@ static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );             
 
 static void Run          ( intf_thread_t * );                  
-static gint Manage       ( gpointer );
 
 /*****************************************************************************
  * Module descriptor
@@ -117,7 +68,14 @@ static int Open( vlc_object_t *p_this )
     if( p_intf->p_sys == NULL )
     {
         msg_Err( p_intf, "out of memory" );
-        return( 1 );
+        return VLC_ENOMEM;
+    }
+
+    p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" );
+    if( p_intf->p_sys->p_gtk_main == NULL )
+    {
+        free( p_intf->p_sys );
+        return VLC_EMODULE;
     }
 
     /* Initialize Gtk+ thread */
@@ -127,7 +85,7 @@ static int Open( vlc_object_t *p_this )
 
     p_intf->pf_run = Run;
 
-    return( 0 );
+    return VLC_SUCCESS;
 }
 
 /*****************************************************************************
@@ -142,8 +100,10 @@ static void Close( vlc_object_t *p_this )
         vlc_object_release( p_intf->p_sys->p_input );
     }
 
+    module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
+
     /* Destroy structure */
-    if (p_intf->p_sys) free( p_intf->p_sys );
+    free( p_intf->p_sys );
 }
 
 /*****************************************************************************
@@ -151,27 +111,10 @@ static void Close( vlc_object_t *p_this )
  *****************************************************************************
  * this part of the interface is in a separate thread so that we can call
  * gtk_main() from within it without annoying the rest of the program.
- * XXX: the approach may look kludgy, and probably is, but I could not find
- * a better way to dynamically load a Gtk+ interface at runtime.
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    /* gtk_init needs to know the command line. We don't care, so we
-     * give it an empty one */
-    char  *p_args[] = { "" };
-    char **pp_args  = p_args;
-    int    i_args   = 1;
-    int    i_dummy;
-
-    /* Initialize Gtk+ */
-    gtk_set_locale ();
-
-    /* gtk_init will register stuff with g_atexit, so we need to take
-     * the global lock if we want to be able to intercept the calls */
-    vlc_mutex_lock( p_intf->p_vlc->p_global_lock );
-    *p_intf->p_vlc->pp_global_data = p_intf;
-    gtk_init( &i_args, &pp_args );
-    vlc_mutex_unlock( p_intf->p_vlc->p_global_lock );
+    gdk_threads_enter();
 
     /* Create some useful widgets that will certainly be used */
 // FIXME: magic path
@@ -203,30 +146,17 @@ static void Run( intf_thread_t *p_intf )
     /* Show the control window */
     gtk_widget_show( p_intf->p_sys->p_window );
 
-    /* Add a check for termination */
-    i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, Manage, p_intf );
-
-    /* Enter Gtk mode */
-    gtk_main();
-
-    /* Remove the timeout */
-    gtk_timeout_remove( i_dummy );
-}
-
-/*****************************************************************************
- * Manage: check for termination
- *****************************************************************************
- * In this function, called approx. 10 times a second, we check whether the
- * main program asked us to die by setting b_die to VLC_TRUE.
- *****************************************************************************/
-static gint Manage( gpointer p_data )
-{
-    if( ((intf_thread_t *)p_data)->b_die )
+    /* Sleep to avoid using all CPU - since some interfaces need to
+     * access keyboard events, a 100ms delay is a good compromise */
+    while( !p_intf->b_die )
     {
-        gtk_main_quit();
-        return FALSE;
+        gdk_threads_leave();
+        msleep( INTF_IDLE_SLEEP );
+        gdk_threads_enter();
     }
 
-    return TRUE;
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
+
+    gdk_threads_leave();
 }
 
index 31857546517829a344a61f7306f7d3f24bf347b2..b12eca84c1049f2722901f3f36b281674939f55d 100644 (file)
@@ -2,7 +2,7 @@
  * familiar.h: private Gtk+ interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: familiar.h,v 1.4 2002/08/18 20:36:04 jpsaman Exp $
+ * $Id: familiar.h,v 1.5 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
  *
@@ -28,6 +28,9 @@
  *****************************************************************************/
 struct intf_sys_t
 {
+    /* The gtk_main module */
+    module_t *          p_gtk_main;
+
     /* windows and widgets */
     GtkWidget *         p_window;                             /* main window */
     GtkNotebook *       p_notebook;
@@ -39,9 +42,6 @@ struct intf_sys_t
     vlc_bool_t          b_autoplayfile;
     /* The input thread */
     input_thread_t *    p_input;
-
-    /* XXX: Ugly kludge, see gtk.c */
-    void             ( *pf_callback[MAX_ATEXIT] ) ( void );
 };
 
 /*****************************************************************************
index 35ce29065ab76088d68d18b07c8cb6c89a52c7ee..86345115a8af02d188c521871c54fef160a14df2 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_common.h: private Gtk+ interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: common.h,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: common.h,v 1.2 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -35,6 +35,9 @@
  *****************************************************************************/
 struct intf_sys_t
 {
+    /* the gtk_main module */
+    module_t *          p_gtk_main;
+
     /* special actions */
     vlc_bool_t          b_playing;
     vlc_bool_t          b_popup_changed;                   /* display menu ? */
@@ -82,9 +85,6 @@ struct intf_sys_t
     GtkLabel *          p_label_title;
     GtkLabel *          p_label_chapter;
     gint                i_part;                           /* current chapter */
-
-    /* XXX: Ugly kludge, see gtk.c */
-    void             ( *pf_callback[MAX_ATEXIT] ) ( void );
 };
 
 /*****************************************************************************
index 8b58538457d7303dca5f9f798274c9bc5e6e3479..e84a8c5d79629e6324f1878dbe6b7cd1857239d4 100644 (file)
@@ -2,7 +2,7 @@
  * gnome.c : Gnome plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: gnome.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: gnome.c,v 1.2 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -47,12 +47,7 @@ static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
 
 static void Run          ( intf_thread_t * );
-static gint Manage       ( gpointer );
-
-/*****************************************************************************
- * Local variables (mutex-protected).
- *****************************************************************************/
-static void ** pp_global_data = NULL;
+static void Manage       ( intf_thread_t * );
 
 /*****************************************************************************
  * Module descriptor
@@ -74,9 +69,7 @@ vlc_module_begin();
 #else
     int i = getenv( "DISPLAY" ) == NULL ? 15 : 100;
 #endif
-    pp_global_data = p_module->p_vlc->pp_global_data;
-    
-    add_category_hint( N_("Miscellaneous"), NULL );
+    add_category_hint( N_("GNOME"), NULL );
     add_bool( "gnome-tooltips", 1, GtkHideTooltips,
               TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT );
     add_bool( "gnome-toolbartext", 1, GtkHideToolbarText, TOOLBAR_TEXT,
@@ -90,49 +83,6 @@ vlc_module_begin();
     set_program( "gnome-vlc" );
 vlc_module_end();
 
-/*****************************************************************************
- * g_atexit: kludge to avoid the Gnome thread to segfault at exit
- *****************************************************************************
- * gtk_init() makes several calls to g_atexit() which calls atexit() to
- * register tidying callbacks to be called at program exit. Since the Gnome
- * plugin is likely to be unloaded at program exit, we have to export this
- * symbol to intercept the g_atexit() calls. Talk about crude hack.
- *****************************************************************************/
-void g_atexit( GVoidFunc func )
-{
-    intf_thread_t *p_intf;
-
-    int i_dummy;
-
-    if( pp_global_data == NULL )
-    {
-        atexit( func );
-        return;
-    }
-
-    p_intf = (intf_thread_t *)*pp_global_data;
-    if( p_intf == NULL )
-    {
-        return;
-    }
-
-    for( i_dummy = 0;
-         i_dummy < MAX_ATEXIT && p_intf->p_sys->pf_callback[i_dummy] != NULL;
-         i_dummy++ )
-    {
-        ;
-    }
-
-    if( i_dummy >= MAX_ATEXIT - 1 )
-    {
-        msg_Err( p_intf, "too many atexit() callbacks to register" );
-        return;
-    }
-
-    p_intf->p_sys->pf_callback[i_dummy]     = func;
-    p_intf->p_sys->pf_callback[i_dummy + 1] = NULL;
-}
-
 /*****************************************************************************
  * Open: initialize and create window
  *****************************************************************************/
@@ -145,7 +95,14 @@ static int Open( vlc_object_t *p_this )
     if( p_intf->p_sys == NULL )
     {
         msg_Err( p_intf, "out of memory" );
-        return( 1 );
+        return VLC_ENOMEM;
+    }
+
+    p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gnome" );
+    if( p_intf->p_sys->p_gtk_main == NULL )
+    {
+        free( p_intf->p_sys );
+        return VLC_EMODULE;
     }
 
     p_intf->pf_run = Run;
@@ -162,11 +119,9 @@ static int Open( vlc_object_t *p_this )
     p_intf->p_sys->i_playing = -1;
     p_intf->p_sys->b_slider_free = 1;
 
-    p_intf->p_sys->pf_callback[0] = NULL;
-
     p_intf->p_sys->i_part = 0;
 
-    return( 0 );
+    return VLC_SUCCESS;
 }
 
 /*****************************************************************************
@@ -183,6 +138,8 @@ static void Close( vlc_object_t *p_this )
 
     msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
 
+    module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
+
     /* Destroy structure */
     free( p_intf->p_sys );
 }
@@ -197,12 +154,6 @@ static void Close( vlc_object_t *p_this )
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    /* gnome_init needs to know the command line. We don't care, so we
-     * give it an empty one */
-    char *p_args[] = { "" };
-    int   i_args   = 1;
-    int   i_dummy;
-
     /* The data types we are allowed to receive */
     static GtkTargetEntry target_table[] =
     {
@@ -211,20 +162,14 @@ static void Run( intf_thread_t *p_intf )
         { "text/plain",    0, DROP_ACCEPT_TEXT_PLAIN }
     };
 
-    /* Initialize Gnome */
-
-    /* gnome_init will register stuff with g_atexit, so we need to take
-     * the global lock if we want to be able to intercept the calls */
-    vlc_mutex_lock( p_intf->p_vlc->p_global_lock );
-    *p_intf->p_vlc->pp_global_data = p_intf;
-    gnome_init( p_intf->p_vlc->psz_object_name, VERSION, i_args, p_args );
-    vlc_mutex_unlock( p_intf->p_vlc->p_global_lock );
+    gdk_threads_enter();
 
     /* Create some useful widgets that will certainly be used */
     p_intf->p_sys->p_window = create_intf_window( );
     p_intf->p_sys->p_popup = create_intf_popup( );
     p_intf->p_sys->p_playwin = create_intf_playlist();
     p_intf->p_sys->p_messages = create_intf_messages();
+    p_intf->p_sys->p_tooltips = gtk_tooltips_new();
 
     /* Set the title of the main window */
     gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
@@ -267,8 +212,6 @@ static void Run( intf_thread_t *p_intf )
     p_intf->p_sys->f_adj_oldvalue = 0;
     #undef P_SLIDER
 
-    p_intf->p_sys->p_tooltips = gtk_tooltips_new();
-
     /* We don't create these ones yet because we perhaps won't need them */
     p_intf->p_sys->p_about = NULL;
     p_intf->p_sys->p_modules = NULL;
@@ -308,26 +251,25 @@ static void Run( intf_thread_t *p_intf )
     /* Show the control window */
     gtk_widget_show( p_intf->p_sys->p_window );
 
-    /* Sleep to avoid using all CPU - since some interfaces needs to access
-     * keyboard events, a 100ms delay is a good compromise */
-    i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, Manage, p_intf );
-
-    /* Enter gnome mode */
-    gtk_main();
+    while( !p_intf->b_die )
+    {
+        Manage( p_intf );
 
-    /* Remove the timeout */
-    gtk_timeout_remove( i_dummy );
+        /* Sleep to avoid using all CPU - since some interfaces need to
+         * access keyboard events, a 100ms delay is a good compromise */
+        gdk_threads_leave();
+        msleep( INTF_IDLE_SLEEP );
+        gdk_threads_enter();
+    }
 
     /* Destroy the Tooltips structure */
     gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_tooltips) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_messages) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_playwin) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_popup) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
 
-    /* Get rid of stored callbacks so we can unload the plugin */
-    for( i_dummy = 0;
-         i_dummy < MAX_ATEXIT && p_intf->p_sys->pf_callback[i_dummy] != NULL;
-         i_dummy++ )
-    {
-        p_intf->p_sys->pf_callback[i_dummy]();
-    }
+    gdk_threads_leave();
 }
 
 /* following functions are local */
@@ -338,9 +280,8 @@ static void Run( intf_thread_t *p_intf )
  * In this function, called approx. 10 times a second, we check what the
  * main program wanted to tell us.
  *****************************************************************************/
-static gint Manage( gpointer p_data )
+static void Manage( intf_thread_t *p_intf )
 {
-#define p_intf ((intf_thread_t *)p_data)
     int i_start, i_stop;
 
     vlc_mutex_lock( &p_intf->change_lock );
@@ -492,21 +433,8 @@ static gint Manage( gpointer p_data )
         p_intf->p_sys->b_playing = 0;
     }
 
-    if( p_intf->b_die )
-    {
-        vlc_mutex_unlock( &p_intf->change_lock );
-
-        /* Prepare to die, young Skywalker */
-        gtk_main_quit();
-
-        /* Just in case */
-        return( FALSE );
-    }
-
     vlc_mutex_unlock( &p_intf->change_lock );
 
-    return( TRUE );
-
-#undef p_intf
+    return;
 }
 
index 7309aa3c49f4003b968a9972092d107b8e667fc1..11750271f0dc3ed9f5ae45df64a275b057718523 100644 (file)
@@ -2,7 +2,7 @@
  * gtk.c : Gtk+ plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: gtk.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: gtk.c,v 1.2 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -49,12 +49,7 @@ static int  Open         ( vlc_object_t * );
 static void Close        ( vlc_object_t * );
 
 static void Run          ( intf_thread_t * );
-static gint Manage       ( gpointer );
-
-/*****************************************************************************
- * Local variables (mutex-protected).
- *****************************************************************************/
-static void ** pp_global_data = NULL;
+static void Manage       ( intf_thread_t * );
 
 /*****************************************************************************
  * Module descriptor
@@ -73,9 +68,7 @@ vlc_module_begin();
 #else
     int i = getenv( "DISPLAY" ) == NULL ? 10 : 90;
 #endif
-    pp_global_data = p_module->p_vlc->pp_global_data;
-
-    add_category_hint( N_("Miscellaneous"), NULL );
+    add_category_hint( N_("Gtk+"), NULL );
     add_bool( "gtk-tooltips", 1, GtkHideTooltips,
               TOOLTIPS_TEXT, TOOLTIPS_LONGTEXT );
     add_integer( "gtk-prefs-maxh", 480, NULL,
@@ -87,49 +80,6 @@ vlc_module_begin();
     set_program( "gvlc" );
 vlc_module_end();
 
-/*****************************************************************************
- * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
- *****************************************************************************
- * gtk_init() makes several calls to g_atexit() which calls atexit() to
- * register tidying callbacks to be called at program exit. Since the Gtk+
- * plugin is likely to be unloaded at program exit, we have to export this
- * symbol to intercept the g_atexit() calls. Talk about crude hack.
- *****************************************************************************/
-void g_atexit( GVoidFunc func )
-{
-    intf_thread_t *p_intf;
-
-    int i_dummy;
-
-    if( pp_global_data == NULL )
-    {
-        atexit( func );
-        return;
-    }
-
-    p_intf = (intf_thread_t *)*pp_global_data;
-    if( p_intf == NULL )
-    {
-        return;
-    }
-
-    for( i_dummy = 0;
-         i_dummy < MAX_ATEXIT && p_intf->p_sys->pf_callback[i_dummy] != NULL;
-         i_dummy++ )
-    {
-        ;
-    }
-
-    if( i_dummy >= MAX_ATEXIT - 1 )
-    {
-        msg_Err( p_intf, "too many atexit() callbacks to register" );
-        return;
-    }
-
-    p_intf->p_sys->pf_callback[i_dummy]     = func;
-    p_intf->p_sys->pf_callback[i_dummy + 1] = NULL;
-}
-
 /*****************************************************************************
  * Open: initialize and create window
  *****************************************************************************/
@@ -142,7 +92,14 @@ static int Open( vlc_object_t *p_this )
     if( p_intf->p_sys == NULL )
     {
         msg_Err( p_intf, "out of memory" );
-        return( 1 );
+        return VLC_ENOMEM;
+    }
+
+    p_intf->p_sys->p_gtk_main = module_Need( p_this, "gtk_main", "gtk" );
+    if( p_intf->p_sys->p_gtk_main == NULL )
+    {
+        free( p_intf->p_sys );
+        return VLC_EMODULE;
     }
 
     p_intf->pf_run = Run;
@@ -159,11 +116,9 @@ static int Open( vlc_object_t *p_this )
     p_intf->p_sys->i_playing = -1;
     p_intf->p_sys->b_slider_free = 1;
 
-    p_intf->p_sys->pf_callback[0] = NULL;
-
     p_intf->p_sys->i_part = 0;
 
-    return( 0 );
+    return VLC_SUCCESS;
 }
 
 /*****************************************************************************
@@ -180,6 +135,8 @@ static void Close( vlc_object_t *p_this )
 
     msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
 
+    module_Unneed( p_intf, p_intf->p_sys->p_gtk_main );
+
     /* Destroy structure */
     free( p_intf->p_sys );
 }
@@ -189,18 +146,9 @@ static void Close( vlc_object_t *p_this )
  *****************************************************************************
  * this part of the interface is in a separate thread so that we can call
  * gtk_main() from within it without annoying the rest of the program.
- * XXX: the approach may look kludgy, and probably is, but I could not find
- * a better way to dynamically load a Gtk+ interface at runtime.
  *****************************************************************************/
 static void Run( intf_thread_t *p_intf )
 {
-    /* gtk_init needs to know the command line. We don't care, so we
-     * give it an empty one */
-    char  *p_args[] = { "" };
-    char **pp_args  = p_args;
-    int    i_args   = 1;
-    int    i_dummy;
-
     /* The data types we are allowed to receive */
     static GtkTargetEntry target_table[] =
     {
@@ -209,14 +157,7 @@ static void Run( intf_thread_t *p_intf )
         { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN }
     };
 
-    /* Initialize Gtk+ */
-
-    /* gtk_init will register stuff with g_atexit, so we need to take
-     * the global lock if we want to be able to intercept the calls */
-    vlc_mutex_lock( p_intf->p_vlc->p_global_lock );
-    *p_intf->p_vlc->pp_global_data = p_intf;
-    gtk_init( &i_args, &pp_args );
-    vlc_mutex_unlock( p_intf->p_vlc->p_global_lock );
+    gdk_threads_enter();
 
     /* Create some useful widgets that will certainly be used */
     p_intf->p_sys->p_window = create_intf_window();
@@ -298,26 +239,25 @@ static void Run( intf_thread_t *p_intf )
     /* Show the control window */
     gtk_widget_show( p_intf->p_sys->p_window );
 
-    /* Sleep to avoid using all CPU - since some interfaces needs to access
-     * keyboard events, a 100ms delay is a good compromise */
-    i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, Manage, p_intf );
-
-    /* Enter Gtk mode */
-    gtk_main();
+    while( !p_intf->b_die )
+    {
+        Manage( p_intf );
 
-    /* Remove the timeout */
-    gtk_timeout_remove( i_dummy );
+        /* Sleep to avoid using all CPU - since some interfaces need to
+         * access keyboard events, a 100ms delay is a good compromise */
+        gdk_threads_leave();
+        msleep( INTF_IDLE_SLEEP );
+        gdk_threads_enter();
+    }
 
     /* Destroy the Tooltips structure */
     gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_tooltips) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_messages) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_playwin) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_popup) );
+    gtk_object_destroy( GTK_OBJECT(p_intf->p_sys->p_window) );
 
-    /* Launch stored callbacks */
-    for( i_dummy = 0;
-         i_dummy < MAX_ATEXIT && p_intf->p_sys->pf_callback[i_dummy] != NULL;
-         i_dummy++ )
-    {
-        p_intf->p_sys->pf_callback[i_dummy]();
-    }
+    gdk_threads_leave();
 }
 
 /* following functions are local */
@@ -328,9 +268,8 @@ static void Run( intf_thread_t *p_intf )
  * In this function, called approx. 10 times a second, we check what the
  * main program wanted to tell us.
  *****************************************************************************/
-static gint Manage( gpointer p_data )
+static void Manage( intf_thread_t *p_intf )
 {
-#define p_intf ((intf_thread_t *)p_data)
     int i_start, i_stop;
 
     vlc_mutex_lock( &p_intf->change_lock );
@@ -394,7 +333,7 @@ static gint Manage( gpointer p_data )
     }
 
     /* Update the playlist */
-    GtkPlayListManage( p_data );
+    GtkPlayListManage( p_intf );
 
     /* Update the input */
     if( p_intf->p_sys->p_input == NULL )
@@ -475,20 +414,5 @@ static gint Manage( gpointer p_data )
         p_intf->p_sys->b_playing = 0;
     }
 
-    if( p_intf->b_die )
-    {
-        vlc_mutex_unlock( &p_intf->change_lock );
-
-        /* Prepare to die, young Skywalker */
-        gtk_main_quit();
-
-        /* Just in case */
-        return( FALSE );
-    }
-
     vlc_mutex_unlock( &p_intf->change_lock );
-
-    return( TRUE );
-
-#undef p_intf
 }
diff --git a/modules/misc/Makefile b/modules/misc/Makefile
new file mode 100644 (file)
index 0000000..aff05ac
--- /dev/null
@@ -0,0 +1,2 @@
+null_SOURCES = null.c
+gtk_main_SOURCES = gtk_main.c
diff --git a/modules/misc/gtk_main.c b/modules/misc/gtk_main.c
new file mode 100644 (file)
index 0000000..cb3fc7c
--- /dev/null
@@ -0,0 +1,245 @@
+/*****************************************************************************
+ * gtk_main.c : Gtk+ wrapper for gtk_main
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: gtk_main.c,v 1.1 2002/08/20 18:08:51 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <vlc/vlc.h>
+
+#include <stdlib.h>                                              /* atexit() */
+
+#include <gtk/gtk.h>
+
+#ifdef HAVE_GNOME_H
+#   include <gnome.h>
+#endif
+
+/*****************************************************************************
+ * Local prototypes.
+ *****************************************************************************/
+static int  Open    ( vlc_object_t * );
+static void Close   ( vlc_object_t * );
+
+static void GtkMain ( vlc_object_t * );
+
+/*****************************************************************************
+ * The gtk_main_t object.
+ *****************************************************************************/
+#define MAX_ATEXIT 10
+
+typedef struct gtk_main_t
+{
+    VLC_COMMON_MEMBERS
+
+    /* XXX: Ugly kludge, see g_atexit */
+    void ( *pf_callback[MAX_ATEXIT] ) ( void );
+
+} gtk_main_t;
+
+/*****************************************************************************
+ * Local variables (mutex-protected).
+ *****************************************************************************/
+static void **       pp_global_data = NULL;
+static int           i_refcount = 0;
+static gtk_main_t *  p_gtk_main = NULL;
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+    pp_global_data = p_module->p_vlc->pp_global_data;
+    set_description( _("Gtk+ helper module") );
+    set_capability( "gtk_main", 100 );
+    add_shortcut( "gtk" );
+#ifdef HAVE_GNOME_H
+    add_shortcut( "gnome" );
+#endif
+    set_callbacks( Open, Close );
+vlc_module_end();
+
+/*****************************************************************************
+ * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit
+ *****************************************************************************
+ * gtk_init() makes several calls to g_atexit() which calls atexit() to
+ * register tidying callbacks to be called at program exit. Since the Gtk+
+ * plugin is likely to be unloaded at program exit, we have to export this
+ * symbol to intercept the g_atexit() calls. Talk about crude hack.
+ *****************************************************************************/
+void g_atexit( GVoidFunc func )
+{
+    gtk_main_t *p_this;
+
+    int i_dummy;
+
+    if( pp_global_data == NULL )
+    {
+        atexit( func );
+        return;
+    }
+
+    p_this = (gtk_main_t *)*pp_global_data;
+    if( p_this == NULL )
+    {
+        /* Looks like this atexit() call wasn't for us. */
+        return;
+    }
+
+    for( i_dummy = 0;
+         i_dummy < MAX_ATEXIT && p_this->pf_callback[i_dummy] != NULL;
+         i_dummy++ )
+    {
+        ;
+    }
+
+    if( i_dummy >= MAX_ATEXIT - 1 )
+    {
+        msg_Err( p_this, "too many atexit() callbacks to register" );
+        return;
+    }
+
+    p_this->pf_callback[i_dummy]     = func;
+    p_this->pf_callback[i_dummy + 1] = NULL;
+}
+
+/*****************************************************************************
+ * Open: initialize and create window
+ *****************************************************************************/
+static int Open( vlc_object_t *p_this )
+{
+    /* Initialize Gtk+ */
+
+    vlc_mutex_lock( p_this->p_vlc->p_global_lock );
+
+    if( i_refcount > 0 )
+    {
+        i_refcount++;
+        vlc_mutex_unlock( p_this->p_vlc->p_global_lock );
+
+        return VLC_SUCCESS;
+    }
+
+    p_gtk_main = vlc_object_create( p_this, sizeof(gtk_main_t) );
+    p_gtk_main->pf_callback[0] = NULL;
+
+    /* Only initialize gthreads if it's the first time we do it */
+    if( !g_thread_supported() )
+    {
+        g_thread_init( NULL );
+    }
+
+    /* Launch the gtk_main() thread. It will not return until it has
+     * called gdk_threads_enter(), which ensures us thread safety. */
+    if( vlc_thread_create( p_gtk_main, "gtk_main", GtkMain, VLC_TRUE ) )
+    {
+        vlc_object_destroy( p_gtk_main );
+        i_refcount--;
+        vlc_mutex_unlock( p_this->p_vlc->p_global_lock );
+        return VLC_ETHREAD;
+    }
+
+    i_refcount++;
+    vlc_mutex_unlock( p_this->p_vlc->p_global_lock );
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * Close: destroy interface window
+ *****************************************************************************/
+static void Close( vlc_object_t *p_this )
+{
+    int i_dummy;
+
+    vlc_mutex_lock( p_this->p_vlc->p_global_lock );
+
+    i_refcount--;
+
+    if( i_refcount > 0 )
+    {
+        vlc_mutex_unlock( p_this->p_vlc->p_global_lock );
+        return;
+    }
+
+    gtk_main_quit();
+    vlc_thread_join( p_gtk_main );
+
+    /* Launch stored callbacks */
+    for( i_dummy = 0;
+         i_dummy < MAX_ATEXIT && p_gtk_main->pf_callback[i_dummy] != NULL;
+         i_dummy++ )
+    {
+        p_gtk_main->pf_callback[i_dummy]();
+    }
+
+    vlc_object_destroy( p_gtk_main );
+    p_gtk_main = NULL;
+
+    vlc_mutex_unlock( p_this->p_vlc->p_global_lock );
+}
+
+static gint foo(gpointer foo)
+{
+    return TRUE;
+}
+
+/*****************************************************************************
+ * GtkMain: Gtk+ thread
+ *****************************************************************************
+ * this part of the interface is in a separate thread so that we can call
+ * gtk_main() from within it without annoying the rest of the program.
+ *****************************************************************************/
+static void GtkMain( vlc_object_t *p_this )
+{
+    /* gtk_init needs to know the command line. We don't care, so we
+     * give it an empty one */
+    static char  *p_args[] = { "" };
+    static char **pp_args  = p_args;
+    static int    i_args   = 1;
+
+    /* gtk_init will register stuff with g_atexit, so we need to have
+     * the global lock if we want to be able to intercept the calls */
+    *p_this->p_vlc->pp_global_data = p_gtk_main;
+
+    /* FIXME: deprecated ? */
+    /* gdk_threads_init(); */
+
+#ifdef HAVE_GNOME_H
+    gnome_init( p_this->p_vlc->psz_object_name, VERSION, i_args, p_args );
+#else
+    gtk_set_locale();
+    gtk_init( &i_args, &pp_args );
+#endif
+
+    gdk_threads_enter();
+
+    vlc_thread_ready( p_this );
+
+    /* If we don't add this simple timeout, gtk_main remains stuck ... */
+    gtk_timeout_add( INTF_IDLE_SLEEP / 1000, foo, p_this );
+
+    /* Enter Gtk mode */
+    gtk_main();
+
+    gdk_threads_leave();
+}
+
similarity index 96%
rename from modules/misc/null/null.c
rename to modules/misc/null.c
index 434d999d0c4795d7db18fd0d55c3e3015eccddb3..046c5e67dcd9c07017debdcc72994601fdc3ee24 100644 (file)
@@ -2,7 +2,7 @@
  * null.c : NULL module for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: null.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: null.c,v 1.1 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
diff --git a/modules/misc/null/Makefile b/modules/misc/null/Makefile
deleted file mode 100644 (file)
index fbea829..0000000
+++ /dev/null
@@ -1 +0,0 @@
-null_SOURCES = null.c
index 9ac664b0718f66a9bcf698160d957bcc442f2fea..b5790462bf5061c355c3d7635676f8ecbafbba11 100644 (file)
@@ -2,7 +2,7 @@
  * vlcplugin.c: a VideoLAN Client plugin for Mozilla
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: vlcplugin.c,v 1.4 2002/08/08 22:28:23 sam Exp $
+ * $Id: vlcplugin.c,v 1.5 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -137,10 +137,13 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
         return NPERR_GENERIC_ERROR;
     }
 
+    vlc_set_r( This->p_vlc, "vout", "xvideo,x11,dummy" );
+    vlc_set_r( This->p_vlc, "intf", "dummy" );
+    vlc_set_r( This->p_vlc, "audio", 0 );
+
     i_ret = vlc_run_r( This->p_vlc );
     if( i_ret )
     {
-        vlc_end_r( This->p_vlc );
         vlc_destroy_r( This->p_vlc );
         This->p_vlc = NULL;
         return NPERR_GENERIC_ERROR;
@@ -159,7 +162,7 @@ NPError NPP_New( NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc,
         }
         else
         {
-            /*__config_PutPsz( This->psz_target, argn[i], argv[i] );*/
+            /*vlc_set_r( This->psz_target, argn[i], argv[i] );*/
         }
     }
 
@@ -179,8 +182,6 @@ NPError NPP_Destroy( NPP instance, NPSavedData** save )
 
     if( This->p_vlc != NULL )
     {
-        vlc_stop_r( This->p_vlc );
-        vlc_end_r( This->p_vlc );
         vlc_destroy_r( This->p_vlc );
         This->p_vlc = NULL;
     }
@@ -211,8 +212,8 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
 
     This = (PluginInstance*) instance->pdata;
 
-    __config_PutInt( This->p_vlc, "x11-drawable", window->window );
-    __config_PutInt( This->p_vlc, "xvideo-drawable", window->window );
+    vlc_set_r( This->p_vlc, "x11-drawable", window->window );
+    vlc_set_r( This->p_vlc, "xvideo-drawable", window->window );
     /*
      * PLUGIN DEVELOPERS:
      * Before setting window to point to the
index dbf15abbc4d3eb49a2bc262d446ab4a76effab2a..2ba86c994b1b6d9235f75446d3ceb008fc992f0d 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.c: main libvlc source
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.c,v 1.28 2002/08/19 11:13:45 sam Exp $
+ * $Id: libvlc.c,v 1.29 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 
 #include <vlc/vlc.h>
 
-#ifdef HAVE_GETOPT_LONG
-#   ifdef HAVE_GETOPT_H
-#       include <getopt.h>                                       /* getopt() */
-#   endif
-#else
-#   include "GNUgetopt/getopt.h"
-#endif
-
 #ifndef WIN32
 #   include <netinet/in.h>                            /* BSD: struct in_addr */
 #endif
@@ -89,8 +81,7 @@ static vlc_mutex_t global_lock;
 void *             p_global_data;
 
 /* A list of all the currently allocated vlc objects */
-static int volatile i_vlc = 0;
-static int volatile i_unique = 0;
+static int      volatile i_vlc = 0;
 static vlc_t ** volatile pp_vlc = NULL;
 
 /*****************************************************************************
@@ -152,6 +143,7 @@ vlc_error_t vlc_create( void )
 
 vlc_t * vlc_create_r( void )
 {
+    static int i_instance = 0;
     vlc_t * p_vlc = NULL;
 
     /* Allocate the main structure */
@@ -181,8 +173,8 @@ vlc_t * vlc_create_r( void )
     pp_vlc = realloc( pp_vlc, (i_vlc+1) * sizeof( vlc_t * ) );
     pp_vlc[ i_vlc ] = p_vlc;
     i_vlc++;
-    p_vlc->i_unique = i_unique;
-    i_unique++;
+    p_vlc->i_instance = i_instance;
+    i_instance++;
     vlc_mutex_unlock( p_vlc->p_global_lock );
 
     /* Update the handle status */
@@ -207,10 +199,11 @@ vlc_error_t vlc_init( int i_argc, char *ppsz_argv[] )
 
 vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
 {
-    char p_capabilities[200];
-    char *p_tmp;
-    module_t        *p_help_module;
-    playlist_t      *p_playlist;
+    char         p_capabilities[200];
+    char *       p_tmp;
+    vlc_bool_t   b_exit;
+    module_t    *p_help_module;
+    playlist_t  *p_playlist;
 
     /* Check that the handle is valid */
     if( !p_vlc || p_vlc->i_status != VLC_STATUS_CREATED )
@@ -304,27 +297,30 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
         return VLC_EGENERIC;
     }
 
+    b_exit = VLC_FALSE;
+
     /* Check for short help option */
     if( config_GetInt( p_vlc, "help" ) )
     {
-        fprintf( stderr, _("Usage: %s [options] [parameters] [file]...\n"),
+        fprintf( stderr, _("Usage: %s [options] [parameters] [files]...\n\n"),
                          p_vlc->psz_object_name );
-
-        Usage( p_vlc, "help" );
         Usage( p_vlc, "main" );
-        vlc_object_detach( p_help_module );
-        config_Free( p_help_module );
-        vlc_object_destroy( p_help_module );
-        module_EndBank( p_vlc );
-        msg_Destroy( p_vlc );
-        return VLC_EEXIT;
+        Usage( p_vlc, "help" );
+        b_exit = VLC_TRUE;
     }
-
     /* Check for version option */
-    if( config_GetInt( p_vlc, "version" ) )
+    else if( config_GetInt( p_vlc, "version" ) )
     {
         Version();
-        vlc_object_detach( p_help_module );
+        b_exit = VLC_TRUE;
+    }
+
+    /* Hack: remove the help module here */
+    vlc_object_detach( p_help_module );
+    /* End hack */
+
+    if( b_exit )
+    {
         config_Free( p_help_module );
         vlc_object_destroy( p_help_module );
         module_EndBank( p_vlc );
@@ -332,10 +328,6 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
         return VLC_EEXIT;
     }
 
-    /* Hack: remove the help module here */
-    vlc_object_detach( p_help_module );
-    /* End hack */
-
     /*
      * Load the builtins and plugins into the module_bank.
      * We have to do it before config_Load*() because this also gets the
@@ -356,36 +348,19 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
     {
         Usage( p_vlc, p_tmp );
         free( p_tmp );
-        vlc_object_detach( p_help_module );
-        config_Free( p_help_module );
-        vlc_object_destroy( p_help_module );
-        module_EndBank( p_vlc );
-        msg_Destroy( p_vlc );
-        return VLC_EGENERIC;
+        b_exit = VLC_TRUE;
     }
-
     /* Check for long help option */
-    if( config_GetInt( p_vlc, "longhelp" ) )
+    else if( config_GetInt( p_vlc, "longhelp" ) )
     {
         Usage( p_vlc, NULL );
-        vlc_object_detach( p_help_module );
-        config_Free( p_help_module );
-        vlc_object_destroy( p_help_module );
-        module_EndBank( p_vlc );
-        msg_Destroy( p_vlc );
-        return VLC_EEXIT;
+        b_exit = VLC_TRUE;
     }
-
     /* Check for module list option */
-    if( config_GetInt( p_vlc, "list" ) )
+    else if( config_GetInt( p_vlc, "list" ) )
     {
         ListModules( p_vlc );
-        vlc_object_detach( p_help_module );
-        config_Free( p_help_module );
-        vlc_object_destroy( p_help_module );
-        module_EndBank( p_vlc );
-        msg_Destroy( p_vlc );
-        return VLC_EEXIT;
+        b_exit = VLC_TRUE;
     }
 
     /* Hack: remove the help module here */
@@ -394,6 +369,13 @@ vlc_error_t vlc_init_r( vlc_t *p_vlc, int i_argc, char *ppsz_argv[] )
     vlc_object_destroy( p_help_module );
     /* End hack */
 
+    if( b_exit )
+    {
+        module_EndBank( p_vlc );
+        msg_Destroy( p_vlc );
+        return VLC_EEXIT;
+    }
+
     /*
      * Override default configuration with config file settings
      */
@@ -615,160 +597,126 @@ vlc_error_t vlc_add_intf_r( vlc_t *p_vlc, const char *psz_module,
 }
 
 /*****************************************************************************
- * vlc_stop: stop playing.
+ * vlc_destroy: stop playing and destroy everything.
  *****************************************************************************
- * This function requests the interface threads to finish, waits for their
+ * This function requests the running threads to finish, waits for their
  * termination, and destroys their structure.
  *****************************************************************************/
-vlc_error_t vlc_stop( void )
+vlc_error_t vlc_destroy( void )
 {
-    return vlc_stop_r( ( i_vlc == 1 ) ? pp_vlc[0] : NULL );
+    return vlc_destroy_r( ( i_vlc == 1 ) ? pp_vlc[0] : NULL );
 }
 
-vlc_error_t vlc_stop_r( vlc_t *p_vlc )
+vlc_error_t vlc_destroy_r( vlc_t *p_vlc )
 {
-    intf_thread_t *p_intf;
-    playlist_t    *p_playlist;
-    vout_thread_t *p_vout;
-    aout_instance_t *p_aout;
+    int               i_index;
+    intf_thread_t *   p_intf;
+    playlist_t    *   p_playlist;
+    vout_thread_t *   p_vout;
+    aout_instance_t * p_aout;
 
     /* Check that the handle is valid */
-    if( !p_vlc || p_vlc->i_status != VLC_STATUS_RUNNING )
+    if( !p_vlc || (p_vlc->i_status != VLC_STATUS_RUNNING
+                    && p_vlc->i_status != VLC_STATUS_STOPPED
+                    && p_vlc->i_status != VLC_STATUS_CREATED) )
     {
-        fprintf( stderr, "error: invalid status (!RUNNING)\n" );
+        fprintf( stderr, "error: invalid status "
+                         "(!RUNNING&&!STOPPED&&!CREATED)\n" );
         return VLC_ESTATUS;
     }
 
-    /*
-     * Ask the interfaces to stop and destroy them
-     */
-    msg_Dbg( p_vlc, "removing all interfaces" );
-    while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF, FIND_CHILD )) )
-    {
-        intf_StopThread( p_intf );
-        vlc_object_detach( p_intf );
-        vlc_object_release( p_intf );
-        intf_Destroy( p_intf );
-    }
-
-    /*
-     * Free playlists
-     */
-    msg_Dbg( p_vlc, "removing all playlists" );
-    while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
-                                          FIND_CHILD )) )
-    {
-        vlc_object_detach( p_playlist );
-        vlc_object_release( p_playlist );
-        playlist_Destroy( p_playlist );
-    }
-
-    /*
-     * Free video outputs
-     */
-    msg_Dbg( p_vlc, "removing all video outputs" );
-    while( (p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT, FIND_CHILD )) )
+    if( p_vlc->i_status == VLC_STATUS_RUNNING )
     {
-        vlc_object_detach( p_vout );
-        vlc_object_release( p_vout );
-        vout_DestroyThread( p_vout );
-    }
-
-    /*
-     * Free audio outputs
-     */
-    msg_Dbg( p_vlc, "removing all audio outputs" );
-    while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT, FIND_CHILD )) )
-    {
-        vlc_object_detach( (vlc_object_t *)p_aout );
-        vlc_object_release( (vlc_object_t *)p_aout );
-        aout_DeleteInstance( p_aout );
-    }
+        /*
+         * Ask the interfaces to stop and destroy them
+         */
+        msg_Dbg( p_vlc, "removing all interfaces" );
+        while( (p_intf = vlc_object_find( p_vlc, VLC_OBJECT_INTF,
+                                                 FIND_CHILD )) )
+        {
+            intf_StopThread( p_intf );
+            vlc_object_detach( p_intf );
+            vlc_object_release( p_intf );
+            intf_Destroy( p_intf );
+        }
 
-    /* Update the handle status */
-    p_vlc->i_status = VLC_STATUS_STOPPED;
+        /*
+         * Free playlists
+         */
+        msg_Dbg( p_vlc, "removing all playlists" );
+        while( (p_playlist = vlc_object_find( p_vlc, VLC_OBJECT_PLAYLIST,
+                                              FIND_CHILD )) )
+        {
+            vlc_object_detach( p_playlist );
+            vlc_object_release( p_playlist );
+            playlist_Destroy( p_playlist );
+        }
 
-    return VLC_SUCCESS;
-}
+        /*
+         * Free video outputs
+         */
+        msg_Dbg( p_vlc, "removing all video outputs" );
+        while( (p_vout = vlc_object_find( p_vlc, VLC_OBJECT_VOUT,
+                                                 FIND_CHILD )) )
+        {
+            vlc_object_detach( p_vout );
+            vlc_object_release( p_vout );
+            vout_DestroyThread( p_vout );
+        }
 
-/*****************************************************************************
- * vlc_end: uninitialize everything.
- *****************************************************************************
- * This function uninitializes every vlc component that was activated in
- * vlc_init: audio and video outputs, playlist, module bank and message queue.
- *****************************************************************************/
-vlc_error_t vlc_end( void )
-{
-    return vlc_end_r( ( i_vlc == 1 ) ? pp_vlc[0] : NULL );
-}
+        /*
+         * Free audio outputs
+         */
+        msg_Dbg( p_vlc, "removing all audio outputs" );
+        while( (p_aout = vlc_object_find( p_vlc, VLC_OBJECT_AOUT,
+                                                 FIND_CHILD )) )
+        {
+            vlc_object_detach( (vlc_object_t *)p_aout );
+            vlc_object_release( (vlc_object_t *)p_aout );
+            aout_DeleteInstance( p_aout );
+        }
 
-vlc_error_t vlc_end_r( vlc_t *p_vlc )
-{
-    /* Check that the handle is valid */
-    if( !p_vlc || p_vlc->i_status != VLC_STATUS_STOPPED )
-    {
-        fprintf( stderr, "error: invalid status (!STOPPED)\n" );
-        return VLC_ESTATUS;
+        /* Update the handle status */
+        p_vlc->i_status = VLC_STATUS_STOPPED;
     }
 
-    /*
-     * Go back into channel 0 which is the network
-     */
-    if( config_GetInt( p_vlc, "network-channel" ) && p_vlc->p_channel )
+    if( p_vlc->i_status == VLC_STATUS_STOPPED )
     {
-        network_ChannelJoin( p_vlc, COMMON_CHANNEL );
-    }
-
-    /*
-     * Free allocated memory
-     */
-    if( p_vlc->p_memcpy_module != NULL )
-    {
-        module_Unneed( p_vlc, p_vlc->p_memcpy_module );
-    }
-
-    free( p_vlc->psz_homedir );
-
-    /*
-     * Free module bank
-     */
-    module_EndBank( p_vlc );
-
-    /*
-     * System specific cleaning code
-     */
-    system_End( p_vlc );
-
-    /*
-     * Terminate messages interface and program
-     */
-    msg_Destroy( p_vlc );
-
-    /* Update the handle status */
-    p_vlc->i_status = VLC_STATUS_CREATED;
-
-    return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * vlc_destroy: free allocated resources.
- *****************************************************************************
- * This function frees the previously allocated vlc_t structure.
- *****************************************************************************/
-vlc_error_t vlc_destroy( void )
-{
-    return vlc_destroy_r( ( i_vlc == 1 ) ? pp_vlc[0] : NULL );
-}
-
-vlc_error_t vlc_destroy_r( vlc_t *p_vlc )
-{
-    int i_index;
+        /*
+         * Go back into channel 0 which is the network
+         */
+        if( config_GetInt( p_vlc, "network-channel" ) && p_vlc->p_channel )
+        {
+            network_ChannelJoin( p_vlc, COMMON_CHANNEL );
+        }
+    
+        /*
+         * Free allocated memory
+         */
+        if( p_vlc->p_memcpy_module != NULL )
+        {
+            module_Unneed( p_vlc, p_vlc->p_memcpy_module );
+        }
+    
+        free( p_vlc->psz_homedir );
+    
+        /*
+         * Free module bank
+         */
+        module_EndBank( p_vlc );
+    
+        /*
+         * System specific cleaning code
+         */
+        system_End( p_vlc );
+    
+        /*
+         * Terminate messages interface and program
+         */
+        msg_Destroy( p_vlc );
 
-    /* Check that the handle is valid */
-    if( !p_vlc || p_vlc->i_status != VLC_STATUS_CREATED )
-    {
-        fprintf( stderr, "error: invalid status (!CREATED)\n" );
-        return VLC_ESTATUS;
+        /* Update the handle status */
+        p_vlc->i_status = VLC_STATUS_CREATED;
     }
 
     /* Update the handle status, just in case */
@@ -913,6 +861,108 @@ vlc_error_t vlc_add_target_r( vlc_t *p_vlc, const char *psz_target,
     return err;
 }
 
+/*****************************************************************************
+ * vlc_set: set a vlc variable
+ *****************************************************************************
+ *
+ *****************************************************************************/
+vlc_error_t vlc_set( const char *psz_var, const char *psz_val )
+{
+    return vlc_set_r( ( i_vlc == 1 ) ? pp_vlc[0] : NULL, psz_var, psz_val );
+}
+
+vlc_error_t vlc_set_r( vlc_t *p_vlc, const char *psz_var, const char *psz_val )
+{
+    module_config_t *p_config;
+
+    if( !p_vlc )
+    {
+        fprintf( stderr, "error: invalid status\n" );
+        return VLC_ESTATUS;
+    }
+
+    p_config = config_FindConfig( VLC_OBJECT(p_vlc), psz_var );
+
+    if( !p_config )
+    {
+        msg_Err( p_vlc, "option %s does not exist", psz_var );
+        return VLC_EGENERIC;
+    }
+
+    vlc_mutex_lock( p_config->p_lock );
+
+    switch( p_config->i_type )
+    {
+    case CONFIG_ITEM_BOOL:
+        if( psz_val && *psz_val )
+        {
+            if( !strcmp( psz_val, "off" ) || !strcmp( psz_val, "no" ) )
+            {
+                p_config->i_value = VLC_FALSE;
+            }
+            else
+            {
+                p_config->i_value = atoi( psz_val );
+            }
+        }
+        else
+        {
+            p_config->i_value = VLC_TRUE;
+        }
+        break;
+    case CONFIG_ITEM_INTEGER:
+        if( psz_val && *psz_val )
+        {
+            p_config->i_value = atoi( psz_val );
+        }
+        else
+        {
+            p_config->i_value = 0;
+        }
+        break;
+    case CONFIG_ITEM_FLOAT:
+        if( psz_val && *psz_val )
+        {
+            p_config->f_value = (float)atof( psz_val );
+        }
+        else
+        {
+            p_config->f_value = 0.0;
+        }
+        break;
+    case CONFIG_ITEM_STRING:
+    case CONFIG_ITEM_FILE:
+    case CONFIG_ITEM_MODULE:
+    default:
+        if( p_config->psz_value )
+        {
+            free( p_config->psz_value );
+        }
+
+        if( psz_val )
+        {
+            p_config->psz_value = strdup( psz_val );
+        }
+        else
+        {
+            p_config->psz_value = NULL;
+        }
+        break;
+    }
+
+    if( p_config->pf_callback )
+    {
+        vlc_mutex_unlock( p_config->p_lock );
+        p_config->pf_callback( VLC_OBJECT(p_vlc) );
+    }
+    else
+    {
+        vlc_mutex_unlock( p_config->p_lock );
+    }
+
+    return VLC_SUCCESS;
+}
+
 /* following functions are local */
 
 /*****************************************************************************
@@ -977,8 +1027,7 @@ static void Usage( vlc_t *p_this, const char *psz_module_name )
          *pp_parser ;
          pp_parser++ )
     {
-        vlc_bool_t b_help_module =
-                       !strcmp( "help", (*pp_parser)->psz_object_name );
+        vlc_bool_t b_help_module;
 
         if( psz_module_name && strcmp( psz_module_name,
                                        (*pp_parser)->psz_object_name ) )
@@ -992,10 +1041,9 @@ static void Usage( vlc_t *p_this, const char *psz_module_name )
             continue;
         }
 
-        /* Print module name */
-        fprintf( stderr, _("%s module options:\n\n"),
-                         (*pp_parser)->psz_object_name );
+        b_help_module = !strcmp( "help", (*pp_parser)->psz_object_name );
 
+        /* Print module options */
         for( p_item = (*pp_parser)->p_config;
              p_item->i_type != CONFIG_HINT_END;
              p_item++ )
@@ -1049,7 +1097,7 @@ static void Usage( vlc_t *p_this, const char *psz_module_name )
                 break;
             }
 
-            /* Add short option */
+            /* Add short option if any */
             if( p_item->i_short )
             {
                 psz_format[2] = '-';
@@ -1071,6 +1119,10 @@ static void Usage( vlc_t *p_this, const char *psz_module_name )
                 if( p_item->i_type == CONFIG_ITEM_BOOL
                      && !b_help_module )
                 {
+                    /* If option is of type --foo-bar, we print its counterpart
+                     * as --no-foo-bar, but if it is of type --foobar (without
+                     * dashes in the name) we print it as --nofoobar. Both
+                     * values are of course valid, only the display changes. */
                     vlc_bool_t b_dash = VLC_FALSE;
                     psz_prefix = p_item->psz_name;
                     while( *psz_prefix )
@@ -1124,9 +1176,6 @@ static void Usage( vlc_t *p_this, const char *psz_module_name )
                 }
             }
         }
-
-        fprintf( stderr, "\n" );
-
     }
 
     /* Release the module list */
@@ -1157,7 +1206,7 @@ static void ListModules( vlc_t *p_this )
 #endif
 
     /* Usage */
-    fprintf( stderr, _("Usage: %s [options] [parameters] [file]...\n\n"),
+    fprintf( stderr, _("Usage: %s [options] [parameters] [files]...\n\n"),
                      p_this->p_vlc->psz_object_name );
 
     fprintf( stderr, _("[module]              [description]\n") );
index 4677528c63caf723b36cc1b9e9c7ed0a05e5ca03..bfeccc95ed223fe79b7cb2d57b478a450da8ac5f 100644 (file)
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -2,7 +2,7 @@
  * vlc.c: the vlc player
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: vlc.c,v 1.9 2002/08/19 11:13:45 sam Exp $
+ * $Id: vlc.c,v 1.10 2002/08/20 18:08:51 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -103,13 +103,7 @@ int main( int i_argc, char *ppsz_argv[] )
     /* Add a blocking interface and keep the return value */
     err = vlc_add_intf( NULL, VLC_TRUE );
 
-    /* Finish the interface */
-    vlc_stop();
-
-    /* Finish all threads */
-    vlc_end();
-
-    /* Destroy the libvlc structure */
+    /* Finish the threads and destroy the libvlc structure */
     vlc_destroy();
 
     return err;