Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

vlc: only print error message if LibVLC is initialized

  • Loading branch information...
commit 697041f622fae3788f23214ec0098ede13de7706 1 parent 8e290e4
Rémi Denis-Courmont authored

Showing 1 changed file with 4 additions and 9 deletions. Show diff stats Hide diff stats

  1. +4 9 bin/vlc.c
13 bin/vlc.c
@@ -49,8 +49,6 @@ extern char *FromLocale (const char *);
49 49 *****************************************************************************/
50 50 int main( int i_argc, const char *ppsz_argv[] )
51 51 {
52   - int i_ret;
53   -
54 52 #ifdef __APPLE__
55 53 /* The so-called POSIX-compliant MacOS X is not.
56 54 * SIGPIPE fires even when it is blocked in all threads! */
@@ -159,17 +157,14 @@ int main( int i_argc, const char *ppsz_argv[] )
159 157 libvlc_add_intf (vlc, NULL, &ex);
160 158 libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
161 159 libvlc_wait (vlc);
  160 +
  161 + if (libvlc_exception_raised (&ex))
  162 + fprintf( stderr, "%s\n", libvlc_errmsg() );
162 163 libvlc_release (vlc);
163 164 }
164   - i_ret = libvlc_exception_raised (&ex);
165   - if( i_ret )
166   - fprintf( stderr, "%s\n", libvlc_errmsg() );
167   -
168   - libvlc_exception_clear (&ex);
169   - libvlc_exception_clear (&dummy);
170 165
171 166 for (int i = 0; i < argc; i++)
172 167 LocaleFree (argv[i]);
173 168
174   - return i_ret;
  169 + return vlc == NULL || libvlc_exception_raised (&ex);
175 170 }

0 comments on commit 697041f

Please sign in to comment.
Something went wrong with that request. Please try again.