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

vlc using libvlc

parent 2a227b41
...@@ -439,7 +439,8 @@ vlc_DEPENDENCIES = $(DATA_win32_rc) libvlc.la ...@@ -439,7 +439,8 @@ vlc_DEPENDENCIES = $(DATA_win32_rc) libvlc.la
vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc` vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc`
vlc_LDFLAGS = `$(VLC_CONFIG) --ldflags vlc` vlc_LDFLAGS = `$(VLC_CONFIG) --ldflags vlc`
vlc_LDADD = $(DATA_win32_rc) libvlccore.la $(LTLIBINTL) \ # vlc needs libvlccore for locale conversion
vlc_LDADD = $(DATA_win32_rc) libvlc.la libvlccore.la $(LTLIBINTL) \
`$(VLC_CONFIG) -libs vlc` `$(VLC_CONFIG) -libs vlc`
if BUILD_VLC if BUILD_VLC
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include "config.h"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
...@@ -63,13 +61,13 @@ static void *SigHandler (void *set); ...@@ -63,13 +61,13 @@ static void *SigHandler (void *set);
*****************************************************************************/ *****************************************************************************/
int main( int i_argc, const char *ppsz_argv[] ) int main( int i_argc, const char *ppsz_argv[] )
{ {
int i_ret, id; int i_ret;
setlocale (LC_ALL, ""); setlocale (LC_ALL, "");
#ifndef __APPLE__ #ifndef __APPLE__
/* This clutters OSX GUI error logs */ /* This clutters OSX GUI error logs */
fprintf( stderr, "VLC media player %s\n", VLC_Version() ); fprintf( stderr, "VLC media player %s\n", libvlc_get_version() );
#endif #endif
#ifdef HAVE_PUTENV #ifdef HAVE_PUTENV
...@@ -89,11 +87,6 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -89,11 +87,6 @@ int main( int i_argc, const char *ppsz_argv[] )
/* FIXME: rootwrap (); */ /* FIXME: rootwrap (); */
#endif #endif
/* Create a libvlc structure */
id = VLC_Create();
if( id < 0 )
return 1;
#if !defined(WIN32) && !defined(UNDER_CE) #if !defined(WIN32) && !defined(UNDER_CE)
/* Synchronously intercepted POSIX signals. /* Synchronously intercepted POSIX signals.
* *
...@@ -181,26 +174,24 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -181,26 +174,24 @@ int main( int i_argc, const char *ppsz_argv[] )
else else
#endif #endif
{ {
/* Note that FromLocale() can be used before libvlc is initialized */
for (int i = 0; i < i_argc; i++) for (int i = 0; i < i_argc; i++)
if ((ppsz_argv[i] = FromLocale (ppsz_argv[i])) == NULL) if ((ppsz_argv[i] = FromLocale (ppsz_argv[i])) == NULL)
return 1; // BOOM! return 1; // BOOM!
} }
libvlc_exception_t ex;
libvlc_exception_init (&ex);
/* Initialize libvlc */ /* Initialize libvlc */
i_ret = VLC_Init( id, i_argc, ppsz_argv ); libvlc_instance_t *vlc = libvlc_new (i_argc, ppsz_argv, &ex);
if( i_ret < 0 ) if (vlc != NULL)
{ {
VLC_Destroy( 0 ); libvlc_run_interface (vlc, NULL, &ex);
return i_ret == VLC_EEXITSUCCESS ? 0 : -i_ret; libvlc_release (vlc);
} }
i_ret = libvlc_exception_raised (&ex);
i_ret = VLC_AddIntf( 0, NULL, true, true ); libvlc_exception_clear (&ex);
/* Finish the threads */
VLC_CleanUp( 0 );
/* Destroy the libvlc structure */
VLC_Destroy( 0 );
for (int i = 0; i < i_argc; i++) for (int i = 0; i < i_argc; i++)
LocaleFree (ppsz_argv[i]); LocaleFree (ppsz_argv[i]);
...@@ -216,7 +207,7 @@ int main( int i_argc, const char *ppsz_argv[] ) ...@@ -216,7 +207,7 @@ int main( int i_argc, const char *ppsz_argv[] )
pthread_join (sigth, NULL); pthread_join (sigth, NULL);
#endif #endif
return -i_ret; return i_ret;
} }
#if !defined(WIN32) && !defined(UNDER_CE) #if !defined(WIN32) && !defined(UNDER_CE)
...@@ -261,7 +252,7 @@ static void *SigHandler (void *data) ...@@ -261,7 +252,7 @@ static void *SigHandler (void *data)
fprintf (stderr, "signal %d received, terminating vlc - do it " fprintf (stderr, "signal %d received, terminating vlc - do it "
"again quickly in case it gets stuck\n", i_signal); "again quickly in case it gets stuck\n", i_signal);
VLC_Die( 0 ); //VLC_Die( 0 );
} }
else /* time (NULL) <= abort_time */ else /* time (NULL) <= abort_time */
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment