Changeset 2a855b131692979ae954939ad5d5a7d78cc21b44

Show
Ignore:
Timestamp:
05/15/08 20:09:08 (3 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1210874948 +0300
git-parent:

[2a227b41898fb77ce4c7f57af144834c54bd740d]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1210871501 +0300
Message:

vlc using libvlc

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/Makefile.am

    r84d0f81 r2a855b1  
    440440vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc` 
    441441vlc_LDFLAGS = `$(VLC_CONFIG) --ldflags vlc` 
    442 vlc_LDADD = $(DATA_win32_rc) libvlccore.la $(LTLIBINTL) \ 
     442# vlc needs libvlccore for locale conversion 
     443vlc_LDADD = $(DATA_win32_rc) libvlc.la libvlccore.la $(LTLIBINTL) \ 
    443444    `$(VLC_CONFIG) -libs vlc` 
    444445 
  • src/vlc.c

    r7db96bf r2a855b1  
    2626 *****************************************************************************/ 
    2727 
    28 #include "config.h" 
    29  
    3028#ifdef HAVE_CONFIG_H 
    3129# include "config.h" 
     
    6462int main( int i_argc, const char *ppsz_argv[] ) 
    6563{ 
    66     int i_ret, id
     64    int i_ret
    6765 
    6866    setlocale (LC_ALL, ""); 
     
    7068#ifndef __APPLE__ 
    7169    /* This clutters OSX GUI error logs */ 
    72     fprintf( stderr, "VLC media player %s\n", VLC_Version() ); 
     70    fprintf( stderr, "VLC media player %s\n", libvlc_get_version() ); 
    7371#endif 
    7472 
     
    8987    /* FIXME: rootwrap (); */ 
    9088#endif 
    91  
    92     /* Create a libvlc structure */ 
    93     id = VLC_Create(); 
    94     if( id < 0 ) 
    95         return 1; 
    9689 
    9790#if !defined(WIN32) && !defined(UNDER_CE) 
     
    182175#endif 
    183176    { 
     177        /* Note that FromLocale() can be used before libvlc is initialized */ 
    184178        for (int i = 0; i < i_argc; i++) 
    185179            if ((ppsz_argv[i] = FromLocale (ppsz_argv[i])) == NULL) 
     
    187181    } 
    188182 
     183    libvlc_exception_t ex; 
     184    libvlc_exception_init (&ex); 
     185 
    189186    /* Initialize libvlc */ 
    190     i_ret = VLC_Init( id, i_argc, ppsz_argv ); 
    191     if( i_ret < 0
     187    libvlc_instance_t *vlc = libvlc_new (i_argc, ppsz_argv, &ex); 
     188    if (vlc != NULL
    192189    { 
    193         VLC_Destroy( 0 ); 
    194         return i_ret == VLC_EEXITSUCCESS ? 0 : -i_ret
     190        libvlc_run_interface (vlc, NULL, &ex); 
     191        libvlc_release (vlc)
    195192    } 
    196  
    197     i_ret = VLC_AddIntf( 0, NULL, true, true ); 
    198  
    199     /* Finish the threads */ 
    200     VLC_CleanUp( 0 ); 
    201  
    202     /* Destroy the libvlc structure */ 
    203     VLC_Destroy( 0 ); 
     193    i_ret = libvlc_exception_raised (&ex); 
     194    libvlc_exception_clear (&ex); 
    204195 
    205196    for (int i = 0; i < i_argc; i++) 
     
    217208#endif 
    218209 
    219     return -i_ret; 
     210    return i_ret; 
    220211} 
    221212 
     
    262253            fprintf (stderr, "signal %d received, terminating vlc - do it " 
    263254                            "again quickly in case it gets stuck\n", i_signal); 
    264             VLC_Die( 0 ); 
     255            //VLC_Die( 0 ); 
    265256        } 
    266257        else /* time (NULL) <= abort_time */