[vlc-devel] commit: macosx/framework: Remove libvlc_exception_t where needed. ( Toralf Niebuhr )

git version control git at videolan.org
Thu Feb 4 01:34:57 CET 2010


vlc | branch: master | Toralf Niebuhr <gmthor85 at aim.com> | Wed Feb  3 20:13:17 2010 +0100| [5f92719d6601aafa5c53237e8809f9301fe2daec] | committer: Pierre d'Herbemont 

macosx/framework: Remove libvlc_exception_t where needed.

Signed-off-by: Pierre d'Herbemont <pdherbemont at free.fr>

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

 projects/macosx/framework/Sources/VLCMedia.m       |   16 +++-------------
 .../macosx/framework/Sources/VLCMediaDiscoverer.m  |    6 +-----
 projects/macosx/framework/Sources/VLCMediaList.m   |   12 +++---------
 3 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/projects/macosx/framework/Sources/VLCMedia.m b/projects/macosx/framework/Sources/VLCMedia.m
index 0fe9289..9da8409 100644
--- a/projects/macosx/framework/Sources/VLCMedia.m
+++ b/projects/macosx/framework/Sources/VLCMedia.m
@@ -177,13 +177,8 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
 {
     if (self = [super init])
     {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
         p_md = libvlc_media_new([VLCLibrary sharedInstance],
-                                           [[anURL absoluteString] UTF8String],
-                                           &ex);
-        catch_exception(&ex);
+                                           [[anURL absoluteString] UTF8String]);
 
         delegate = nil;
         metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
@@ -201,13 +196,8 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
 {
     if (self = [super init])
     {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
-
         p_md = libvlc_media_new_as_node([VLCLibrary sharedInstance],
-                                                   [aName UTF8String],
-                                                   &ex);
-        catch_exception(&ex);
+                                                   [aName UTF8String]);
 
         delegate = nil;
         metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
@@ -277,7 +267,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     if (!length)
     {
         // Try figuring out what the length is
-        long long duration = libvlc_media_get_duration( p_md, NULL );
+        long long duration = libvlc_media_get_duration( p_md );
         if (duration > -1)
         {
             length = [[VLCTime timeWithNumber:[NSNumber numberWithLongLong:duration]] retain];
diff --git a/projects/macosx/framework/Sources/VLCMediaDiscoverer.m b/projects/macosx/framework/Sources/VLCMediaDiscoverer.m
index 00ac08b..74d76e1 100644
--- a/projects/macosx/framework/Sources/VLCMediaDiscoverer.m
+++ b/projects/macosx/framework/Sources/VLCMediaDiscoverer.m
@@ -89,14 +89,10 @@ static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * use
 {
     if (self = [super init])
     {
-        libvlc_exception_t ex;
-        libvlc_exception_init(&ex);
         localizedName = nil;
         discoveredMedia = nil;
         mdis = libvlc_media_discoverer_new_from_name([VLCLibrary sharedInstance],
-                                                     [aServiceName UTF8String],
-                                                     &ex);
-        catch_exception(&ex);
+                                                     [aServiceName UTF8String]);
 
         libvlc_event_manager_t * p_em = libvlc_media_discoverer_event_manager(mdis);
         libvlc_event_attach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self);
diff --git a/projects/macosx/framework/Sources/VLCMediaList.m b/projects/macosx/framework/Sources/VLCMediaList.m
index 6001be0..7d04436 100644
--- a/projects/macosx/framework/Sources/VLCMediaList.m
+++ b/projects/macosx/framework/Sources/VLCMediaList.m
@@ -146,10 +146,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
     [media retain];
 
     // Add it to the libvlc's medialist
-    libvlc_exception_t p_e;
-    libvlc_exception_init( &p_e );
-    libvlc_media_list_insert_media( p_mlist, [media libVLCMediaDescriptor], index, &p_e );
-    catch_exception( &p_e );
+    libvlc_media_list_insert_media(p_mlist, [media libVLCMediaDescriptor], index);
 }
 
 - (void)removeMediaAtIndex:(NSInteger)index
@@ -157,10 +154,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
     [[self mediaAtIndex:index] release];
 
     // Remove it from the libvlc's medialist
-    libvlc_exception_t p_e;
-    libvlc_exception_init( &p_e );
-    libvlc_media_list_remove_index( p_mlist, index, &p_e );
-    catch_exception( &p_e );
+    libvlc_media_list_remove_index(p_mlist, index);
 }
 
 - (VLCMedia *)mediaAtIndex:(NSInteger)index
@@ -227,7 +221,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
         NSUInteger i, count = libvlc_media_list_count(p_mlist);
         for( i = 0; i < count; i++ )
         {
-            libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_mlist, i, NULL );
+            libvlc_media_t * p_md = libvlc_media_list_item_at_index(p_mlist, i);
             [cachedMedia addObject:[VLCMedia mediaWithLibVLCMediaDescriptor:p_md]];
             libvlc_media_release(p_md);
         }




More information about the vlc-devel mailing list