~ubuntu-branches/ubuntu/saucy/shotwell/saucy-proposed

« back to all changes in this revision

Viewing changes to src/VideoSupport.vala

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Alberto Mardegan
  • Date: 2013-03-19 19:34:19 UTC
  • mfrom: (1.2.18)
  • Revision ID: package-import@ubuntu.com-20130319193419-ed5bq7690j3c8pp1
Tags: 0.14.0-0ubuntu1
* New upstream version
* debian/control: drop leftover build-depends on libgnomevfs2-dev

[ Alberto Mardegan]
* debian/patches/06_uoa.patch: new version update

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
public class VideoReader {
39
39
    private const double UNKNOWN_CLIP_DURATION = -1.0;
40
 
    private const uint THUMBNAILER_TIMEOUT = 5000; // In milliseconds.
 
40
    private const uint THUMBNAILER_TIMEOUT = 10000; // In milliseconds.
 
41
 
 
42
    // File extensions for video containers that pack only metadata as per the AVCHD spec
 
43
    private const string[] METADATA_ONLY_FILE_EXTENSIONS = { "bdm", "bdmv", "cpi", "mpl" };
41
44
    
42
45
    private double clip_duration = UNKNOWN_CLIP_DURATION;
43
46
    private Gdk.Pixbuf preview_frame = null;
56
59
    public static bool is_supported_video_filename(string filename) {
57
60
        string mime_type;
58
61
        mime_type = ContentType.guess(filename, new uchar[0], null);
59
 
        return (mime_type.length >= 6 && mime_type[0:6] == "video/");
 
62
        if (mime_type.length >= 6 && mime_type[0:6] == "video/") {
 
63
            string? extension = null;
 
64
            string? name = null;
 
65
            disassemble_filename(filename, out name, out extension);
 
66
            
 
67
            if (extension == null)
 
68
                return true;
 
69
 
 
70
            foreach (string s in METADATA_ONLY_FILE_EXTENSIONS) {
 
71
                if (utf8_ci_compare(s, extension) == 0)
 
72
                    return false;
 
73
            }
 
74
                
 
75
            return true;
 
76
        } else {
 
77
            return false;
 
78
        }
60
79
    }
61
80
    
62
81
    public static ImportResult prepare_for_import(VideoImportParams params) {