diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2013-10-04 07:51:46 +0200 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2013-10-04 09:58:57 +0200 |
commit | 517f290476837653b7971c97679e9c2e5112083a (patch) | |
tree | b7adb90b188bac95760fc5fb6c9ec76715750f12 | |
parent | 75e1f5040a2fdd744710023bf0b7a7f4d2c65a27 (diff) |
mi-info: pretty print framerates
Avoid to print 0 fps. Handle the special 0/1 case for still images.
-rw-r--r-- | mediainfo/src/mi-info.vala | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mediainfo/src/mi-info.vala b/mediainfo/src/mi-info.vala index ef509c2..a74f665 100644 --- a/mediainfo/src/mi-info.vala +++ b/mediainfo/src/mi-info.vala @@ -618,7 +618,18 @@ public class MediaInfo.Info : Box double fps_num = (double)vinfo.get_framerate_num(); double fps_denom = (double)vinfo.get_framerate_denom(); - str = "%.3lf frames/second".printf (fps_num/fps_denom); + if (fps_num != 0) { + str = "%.3lf frames/second".printf (fps_num/fps_denom); + } else { + if (fps_denom == 1) { + // TODO(ensonic): there are a few files where video is flaged as still image + // ~/temp/Video/luc_00036.MTS + // ~/temp/Video/lookinggood.asx + str = "still image"; + } else { + str = "unknown"; + } + } add_table_row_for_string (table, row, "Framerate:", str); row++; |