Changeset 2a855b131692979ae954939ad5d5a7d78cc21b44
- 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
| r84d0f81 |
r2a855b1 |
|
| 440 | 440 | vlc_CFLAGS = `$(VLC_CONFIG) --cflags vlc` |
|---|
| 441 | 441 | vlc_LDFLAGS = `$(VLC_CONFIG) --ldflags vlc` |
|---|
| 442 | | vlc_LDADD = $(DATA_win32_rc) libvlccore.la $(LTLIBINTL) \ |
|---|
| | 442 | # vlc needs libvlccore for locale conversion |
|---|
| | 443 | vlc_LDADD = $(DATA_win32_rc) libvlc.la libvlccore.la $(LTLIBINTL) \ |
|---|
| 443 | 444 | `$(VLC_CONFIG) -libs vlc` |
|---|
| 444 | 445 | |
|---|
| r7db96bf |
r2a855b1 |
|
| 26 | 26 | *****************************************************************************/ |
|---|
| 27 | 27 | |
|---|
| 28 | | #include "config.h" |
|---|
| 29 | | |
|---|
| 30 | 28 | #ifdef HAVE_CONFIG_H |
|---|
| 31 | 29 | # include "config.h" |
|---|
| … | … | |
| 64 | 62 | int main( int i_argc, const char *ppsz_argv[] ) |
|---|
| 65 | 63 | { |
|---|
| 66 | | int i_ret, id; |
|---|
| | 64 | int i_ret; |
|---|
| 67 | 65 | |
|---|
| 68 | 66 | setlocale (LC_ALL, ""); |
|---|
| … | … | |
| 70 | 68 | #ifndef __APPLE__ |
|---|
| 71 | 69 | /* 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() ); |
|---|
| 73 | 71 | #endif |
|---|
| 74 | 72 | |
|---|
| … | … | |
| 89 | 87 | /* FIXME: rootwrap (); */ |
|---|
| 90 | 88 | #endif |
|---|
| 91 | | |
|---|
| 92 | | /* Create a libvlc structure */ |
|---|
| 93 | | id = VLC_Create(); |
|---|
| 94 | | if( id < 0 ) |
|---|
| 95 | | return 1; |
|---|
| 96 | 89 | |
|---|
| 97 | 90 | #if !defined(WIN32) && !defined(UNDER_CE) |
|---|
| … | … | |
| 182 | 175 | #endif |
|---|
| 183 | 176 | { |
|---|
| | 177 | /* Note that FromLocale() can be used before libvlc is initialized */ |
|---|
| 184 | 178 | for (int i = 0; i < i_argc; i++) |
|---|
| 185 | 179 | if ((ppsz_argv[i] = FromLocale (ppsz_argv[i])) == NULL) |
|---|
| … | … | |
| 187 | 181 | } |
|---|
| 188 | 182 | |
|---|
| | 183 | libvlc_exception_t ex; |
|---|
| | 184 | libvlc_exception_init (&ex); |
|---|
| | 185 | |
|---|
| 189 | 186 | /* 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) |
|---|
| 192 | 189 | { |
|---|
| 193 | | VLC_Destroy( 0 ); |
|---|
| 194 | | return i_ret == VLC_EEXITSUCCESS ? 0 : -i_ret; |
|---|
| | 190 | libvlc_run_interface (vlc, NULL, &ex); |
|---|
| | 191 | libvlc_release (vlc); |
|---|
| 195 | 192 | } |
|---|
| 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); |
|---|
| 204 | 195 | |
|---|
| 205 | 196 | for (int i = 0; i < i_argc; i++) |
|---|
| … | … | |
| 217 | 208 | #endif |
|---|
| 218 | 209 | |
|---|
| 219 | | return -i_ret; |
|---|
| | 210 | return i_ret; |
|---|
| 220 | 211 | } |
|---|
| 221 | 212 | |
|---|
| … | … | |
| 262 | 253 | fprintf (stderr, "signal %d received, terminating vlc - do it " |
|---|
| 263 | 254 | "again quickly in case it gets stuck\n", i_signal); |
|---|
| 264 | | VLC_Die( 0 ); |
|---|
| | 255 | //VLC_Die( 0 ); |
|---|
| 265 | 256 | } |
|---|
| 266 | 257 | else /* time (NULL) <= abort_time */ |
|---|