From: Sam Hocevar Date: Mon, 28 Oct 2002 16:26:44 +0000 (+0000) Subject: * ./configure.ac.in: we explicitely link the dvdplay plugin with libdvdcss X-Git-Tag: 0.5.0~806 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b316e6e8b580ba76c92f335331245eddd640865f;p=vlc * ./configure.ac.in: we explicitely link the dvdplay plugin with libdvdcss if it was found. * ./modules/access/dvdplay/tools.c: we don't try to stat the device if it looks like a Win32 drive. * ./src/misc/messages.c: we only flush stderr under Win32. --- diff --git a/configure.ac.in b/configure.ac.in index 9f55e922c2..e5830c61ab 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -763,7 +763,8 @@ then then AC_CHECK_HEADERS(dvdcss/dvdcss.h, [ PLUGINS="${PLUGINS} dvd" - LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss" ], + LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss" + LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ], [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss= for dynamic linking (recommended under Unix) or --with-dvdcss-tree= for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.]) AC_MSG_ERROR([cannot find libdvdcss headers]) ]) else @@ -781,6 +782,7 @@ then AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a) BUILTINS="${BUILTINS} dvd" LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a" + LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a" CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src" else dnl The given libdvdcss wasn't built @@ -803,6 +805,7 @@ then AC_MSG_RESULT(yes) PLUGINS="${PLUGINS} dvd" LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss" + LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss" CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include" else dnl No libdvdcss could be found, sorry @@ -835,7 +838,7 @@ then AC_TRY_COMPILE([#include ], [int foo() { return DVD_VIDEO_LB_LEN; }],[ PLUGINS="${PLUGINS} dvdread" - LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread" + LDFLAGS_dvdread="${LDFLAGS_dvdread} ${LDFLAGS_test} -ldvdread ${LDFLAGS_dvdcss}" CPPFLAGS_dvdread="${CPPFLAGS_dvdread} ${CPPFLAGS_test}" ],[ if test "x${enable_dvdread}" != "x" @@ -877,7 +880,7 @@ then CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}" AC_CHECK_HEADERS(dvdplay/dvdplay.h, [ PLUGINS="${PLUGINS} dvdplay" - LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread" + LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_test} -ldvdplay -ldvdread ${LDFLAGS_dvdcss}" CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_test}" ],[ if test "x${enable_dvdplay}" != x diff --git a/modules/access/dvdplay/tools.c b/modules/access/dvdplay/tools.c index e00d7038b1..336ad71b8d 100644 --- a/modules/access/dvdplay/tools.c +++ b/modules/access/dvdplay/tools.c @@ -2,7 +2,7 @@ * tools.c: tools for dvd plugin. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: tools.c,v 1.2 2002/10/23 21:54:33 gbazin Exp $ + * $Id: tools.c,v 1.3 2002/10/28 16:26:44 sam Exp $ * * Author: Stéphane Borel * @@ -100,21 +100,30 @@ char * dvdplay_ParseCL( input_thread_t * p_input, if( !psz_source ) return NULL; } - if( stat( psz_source, &stat_info ) == -1 ) +#ifdef WIN32 + if( psz_source[0] && psz_source[1] == ':' && psz_source[2] == '\0' ) { - msg_Err( p_input, "cannot stat() source `%s' (%s)", - psz_source, strerror(errno)); - free( psz_source ); - return NULL; + /* Don't try to stat the file */ } - if( !S_ISBLK(stat_info.st_mode) && - !S_ISCHR(stat_info.st_mode) && - !S_ISDIR(stat_info.st_mode) ) + else +#endif { - msg_Dbg( p_input, "plugin discarded" - " (not a valid source)" ); - free( psz_source ); - return NULL; + if( stat( psz_source, &stat_info ) == -1 ) + { + msg_Warn( p_input, "cannot stat() source `%s' (%s)", + psz_source, strerror(errno) ); + free( psz_source ); + return NULL; + } + + if( !S_ISBLK(stat_info.st_mode) && + !S_ISCHR(stat_info.st_mode) && + !S_ISDIR(stat_info.st_mode) ) + { + msg_Dbg( p_input, "plugin discarded (not a valid source)" ); + free( psz_source ); + return NULL; + } } msg_Dbg( p_input, "dvdroot=%s title=%d chapter=%d angle=%d", diff --git a/src/misc/messages.c b/src/misc/messages.c index fb33a1425f..f39b8ee934 100644 --- a/src/misc/messages.c +++ b/src/misc/messages.c @@ -4,7 +4,7 @@ * modules, especially intf modules. See config.h for output configuration. ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: messages.c,v 1.16 2002/10/22 21:10:28 sam Exp $ + * $Id: messages.c,v 1.17 2002/10/28 16:26:44 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -481,7 +481,9 @@ static void PrintMsg ( vlc_object_t * p_this, msg_item_t * p_item ) p_item->psz_msg ); } +#ifdef WIN32 fflush( stderr ); +#endif } /*****************************************************************************