[Rhythmbox-devel] [PATCH] rb-mtp-source.c add mimetype handling for video/x-ms-asf



I have some songs in my collection that were needlessly being converted when transferred via MTP, due to mimetype not being handled. Patch below:

Index: rb-mtp-source.c
===================================================================
--- rb-mtp-source.c    (revision 5912)
+++ rb-mtp-source.c    (working copy)
@@ -375,7 +375,7 @@
 
     g_assert (db != NULL);
 
-    tracks = LIBMTP_Get_Tracklisting (priv->device);
+    tracks = LIBMTP_Get_Tracklisting_With_Callback (priv->device, NULL, NULL);
     if (tracks != NULL) {
         LIBMTP_track_t *track, *tmp = NULL;
         for (track = tracks; track != NULL; track = track->next) {
@@ -469,6 +469,8 @@
         return LIBMTP_FILETYPE_MP4;
     } else if (!strcmp (mimetype, "audio/x-ms-wma") || !strcmp (mimetype, "audio/x-ms-asf")) {
         return LIBMTP_FILETYPE_WMA;
+    } else if (!strcmp (mimetype, "video/x-ms-asf")) {
+        return LIBMTP_FILETYPE_ASF;
     } else {
         rb_debug ("\"%s\" is not a supported mimetype", mimetype);
         return LIBMTP_FILETYPE_UNKNOWN;
@@ -490,6 +492,8 @@
         return "audio/mp4";
     } else if (filetype == LIBMTP_FILETYPE_WMV) {
         return "audio/x-ms-wmv";
+    } else if (filetype == LIBMTP_FILETYPE_ASF) {
+        return "video/x-ms-asf";
     } else {
         return NULL;
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]