Changeset 24a43144ff5055f2a1b96f3d70a1f681583394bd
- Timestamp:
- 25/09/06 17:51:22
(2 years ago)
- Author:
- Olivier Aubert <olivier.aubert@liris.cnrs.fr>
- git-committer:
- Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1159199482 +0000
- git-parent:
[f8ba1a1175ce01b5510d6fea1e23218025a118e6]
- git-author:
- Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1159199482 +0000
- Message:
src/control/core.c: prepend a dummy argv[0] to libvlc_new() argv, so
that users of the API can simply pass parameters
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| re85a5a6 |
r24a4314 |
|
| 84 | 84 | { |
|---|
| 85 | 85 | libvlc_instance_t *p_new; |
|---|
| | 86 | int i_index; |
|---|
| | 87 | char** ppsz_argv = NULL; |
|---|
| 86 | 88 | |
|---|
| 87 | 89 | libvlc_int_t *p_libvlc_int = libvlc_InternalCreate(); |
|---|
| … | … | |
| 92 | 94 | |
|---|
| 93 | 95 | /** \todo Look for interface settings. If we don't have any, add -I dummy */ |
|---|
| 94 | | /* Because we probably don't want a GUI by default */ |
|---|
| | 96 | /* Because we probably don't want a GUI by default */ |
|---|
| 95 | 97 | |
|---|
| 96 | | if( libvlc_InternalInit( p_libvlc_int, argc, argv ) ) |
|---|
| | 98 | /* Prepend a dummy argv[0] so that users of the libvlc API do not have to |
|---|
| | 99 | do it themselves, and can simply provide the args list. */ |
|---|
| | 100 | ppsz_argv = malloc( ( argc + 2 ) * sizeof( char * ) ) ; |
|---|
| | 101 | if( ! ppsz_argv ) |
|---|
| | 102 | RAISENULL( "Out of memory" ); |
|---|
| | 103 | |
|---|
| | 104 | ppsz_argv[0] = strdup("vlc"); |
|---|
| | 105 | for ( i_index = 0; i_index < argc; i_index++ ) |
|---|
| | 106 | ppsz_argv[i_index + 1] = argv[i_index]; |
|---|
| | 107 | ppsz_argv[argc + 1] = NULL; |
|---|
| | 108 | |
|---|
| | 109 | if( libvlc_InternalInit( p_libvlc_int, argc + 1, ppsz_argv ) ) |
|---|
| 97 | 110 | RAISENULL( "VLC initialization failed" ); |
|---|
| 98 | 111 | |
|---|
| 99 | 112 | p_new->p_libvlc_int = p_libvlc_int; |
|---|
| 100 | 113 | p_new->p_vlm = NULL; |
|---|
| | 114 | |
|---|
| 101 | 115 | return p_new; |
|---|
| 102 | 116 | } |
|---|