OSDN Git Service

Always consider m4a files as audio, even when they contain a video track.
authorMarco Nelissen <marcone@google.com>
Mon, 28 Sep 2009 16:03:33 +0000 (09:03 -0700)
committerMarco Nelissen <marcone@google.com>
Mon, 28 Sep 2009 16:03:33 +0000 (09:03 -0700)
media/java/android/media/MediaScanner.java

index 3a3ae5f..afdc8f7 100644 (file)
@@ -610,6 +610,13 @@ public class MediaScanner
         }
 
         public void setMimeType(String mimeType) {
+            if ("audio/mp4".equals(mMimeType) &&
+                    mimeType.startsWith("video")) {
+                // for feature parity with Donut, we force m4a files to keep the
+                // audio/mp4 mimetype, even if they are really "enhanced podcasts"
+                // with a video track
+                return;
+            }
             mMimeType = mimeType;
             mFileType = MediaFile.getFileTypeForMimeType(mimeType);
         }