[vlc-devel] commit: media_discoverer: Typo fix. Don't add the media twice. (Pierre d' Herbemont )

git version control git at videolan.org
Thu Apr 17 00:38:43 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Thu Apr 17 00:37:02 2008 +0200| [0e463771bba51b4b3f1fba2f0274e5b3ccee6dc0]

media_discoverer: Typo fix. Don't add the media twice.

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

 src/control/media_discoverer.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/control/media_discoverer.c b/src/control/media_discoverer.c
index 0cce5c9..e96e295 100644
--- a/src/control/media_discoverer.c
+++ b/src/control/media_discoverer.c
@@ -51,7 +51,6 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
      * that category in a media_list. */
     if( psz_cat )
     {
-        p_mlist = kVLCDictionaryNotFound;
         p_mlist = vlc_dictionary_value_for_key( &p_mdis->catname_to_submedialist, psz_cat );
 
         if( p_mlist == kVLCDictionaryNotFound )
@@ -62,7 +61,7 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
             p_mlist->b_read_only = true;
 
             /* Insert the newly created mlist in our dictionary */
-            __vlc_dictionary_insert( &p_mdis->catname_to_submedialist, psz_cat, p_mlist, 0 );
+            vlc_dictionary_insert( &p_mdis->catname_to_submedialist, psz_cat, p_mlist );
             
             /* Insert the md into the root list */
             libvlc_media_list_lock( p_mdis->p_mlist );
@@ -74,10 +73,12 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
             libvlc_media_release( p_catmd );
         }
     }
-
-    libvlc_media_list_lock( p_mlist );
-    _libvlc_media_list_add_media( p_mlist, p_md, NULL );
-    libvlc_media_list_unlock( p_mlist );
+    else
+    {
+        libvlc_media_list_lock( p_mlist );
+        _libvlc_media_list_add_media( p_mlist, p_md, NULL );
+        libvlc_media_list_unlock( p_mlist );
+    }
 }
 
 /**************************************************************************




More information about the vlc-devel mailing list