[vlc-devel] commit: Ignore exceptions correctly - don't let libvlc assert ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Jun 4 18:57:44 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Jun  4 19:59:28 2008 +0300| [c15a5164ddd9105ce4de09fc9dcd95d4263ad3df]

Ignore exceptions correctly - don't let libvlc assert

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c15a5164ddd9105ce4de09fc9dcd95d4263ad3df
---

 src/vlc.c    |    8 +++++---
 src/winvlc.c |    6 ++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/vlc.c b/src/vlc.c
index 3f17c3a..0a77e34 100644
--- a/src/vlc.c
+++ b/src/vlc.c
@@ -115,8 +115,9 @@ int main( int i_argc, const char *ppsz_argv[] )
         if ((ppsz_argv[i] = FromLocale (ppsz_argv[i])) == NULL)
             return 1; // BOOM!
 
-    libvlc_exception_t ex;
+    libvlc_exception_t ex, dummy;
     libvlc_exception_init (&ex);
+    libvlc_exception_init (&dummy);
 
     /* Initialize libvlc */
     int i_argc_real = i_argc ? i_argc - 1 : 0;
@@ -125,9 +126,9 @@ int main( int i_argc, const char *ppsz_argv[] )
 
     if (vlc != NULL)
     {
-        libvlc_add_intf (vlc, "signals", NULL);
+        libvlc_add_intf (vlc, "signals", &dummy);
         libvlc_add_intf (vlc, NULL, &ex);
-        libvlc_playlist_play (vlc, -1, 0, NULL, NULL);
+        libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
         libvlc_wait (vlc);
         libvlc_release (vlc);
     }
@@ -136,6 +137,7 @@ int main( int i_argc, const char *ppsz_argv[] )
         fprintf( stderr, "%s\n", libvlc_exception_get_message( &ex));
 
     libvlc_exception_clear (&ex);
+    libvlc_exception_clear (&dummy);
 
     for (int i = 0; i < i_argc; i++)
         LocaleFree (ppsz_argv[i]);
diff --git a/src/winvlc.c b/src/winvlc.c
index 4925917..80f2259 100644
--- a/src/winvlc.c
+++ b/src/winvlc.c
@@ -103,15 +103,16 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 
     argc = parse_cmdline (psz_cmdline, &argv);
 
-    libvlc_exception_t ex;
+    libvlc_exception_t ex, dummy;
     libvlc_exception_init (&ex);
+    libvlc_exception_init (&dummy);
 
     /* Initialize libvlc */
     libvlc_instance_t *vlc = libvlc_new (argc, (const char **)argv, &ex);
     if (vlc != NULL)
     {
         libvlc_add_intf (vlc, NULL, &ex);
-        libvlc_playlist_play (vlc, -1, 0, NULL, NULL);
+        libvlc_playlist_play (vlc, -1, 0, NULL, &dummy);
         libvlc_wait (vlc);
         libvlc_release (vlc);
     }
@@ -119,6 +120,7 @@ int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 
     ret = libvlc_exception_raised (&ex);
     libvlc_exception_clear (&ex);
+    libvlc_exception_clear (&dummy);
     return ret;
 }
 




More information about the vlc-devel mailing list