[shotwell] Do not filter out application/x-extension-mp4 from VideoSupport



commit 3b42439efa04bfa63d0a3c5d00a30cb09948f5b1
Author: Jens Georg <mail jensge org>
Date:   Sat Sep 16 09:13:39 2017 +0200

    Do not filter out application/x-extension-mp4 from VideoSupport
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773206

 src/VideoSupport.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/VideoSupport.vala b/src/VideoSupport.vala
index 17cb189..857a901 100644
--- a/src/VideoSupport.vala
+++ b/src/VideoSupport.vala
@@ -74,7 +74,8 @@ public class VideoReader {
     public static bool is_supported_video_filename(string filename) {
         string mime_type;
         mime_type = ContentType.guess(filename, new uchar[0], null);
-        if (mime_type.length >= 6 && mime_type[0:6] == "video/") {
+        // Guessed mp4 from filename has application/ as prefix, so check for mp4 in the end
+        if (mime_type.has_prefix ("video/") || mime_type.has_suffix("mp4")) {
             string? extension = null;
             string? name = null;
             disassemble_filename(filename, out name, out extension);


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