[vlc-devel] [PATCH][SoC] MTP devices support

Rémi Denis-Courmont rem at videolan.org
Thu Sep 4 18:23:43 CEST 2008


	Hello,

Le mercredi 3 septembre 2008 16:56:38 Fabio Ritrovato, vous avez écrit :
> here's the patches for my SoC work.
> The first patch expand the services discovery API, to allow editable
> SDs, by adding some callbacks.
> The second patch, does a little rework of the meta writing process (i
> had to edit the macosx interface, or else it'd have been broken, but i
> can't test it... but it should work)
> Patch 3 to 7 implements the new SDs capabilities in the main
> interfaces, plus some enhancement in the luarc interface.
> Patch 8 is the actual MTP support, with the service discovery, with a
> meta writer submodule, and the access module...

Tiny bug here (and possibly in other uses of asprintf()). 
If asprintf() fails (very unlikely), the target pointer is undefined:

+    if( asprintf( &p_item->psz_uri, "mtp://%d:%d:%d:%d%s", i_bus, i_dev, 
i_product_id, i_new_id, psz_extension ) == -1 )
+        msg_Err( p_object, "Error updating playlist item..." );
+    else
+        msg_Info( p_object, "Metadata updated..." );

Otherwise, it seems that the access module has a lot of useless code, though 
that's a minor issue, and some old constructs (e.g. checking b_die directly).


Finally, you are using msleep() in a lame way, instead of waiting for events 
properly. Many other interface and service discovery plugins have the same 
problem, but it would be worth checking if libmtp cannot do better.

-- 
Rémi Denis-Courmont
http://git.remlab.net/cgi-bin/gitweb.cgi?p=vlc-courmisch.git;a=summary



More information about the vlc-devel mailing list