chiark / gitweb /
plugins/tracklength-gstreamer.c: Use `GST_SECOND' instead of `1000...'.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 13 Jul 2018 10:55:02 +0000 (11:55 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 13 Jul 2018 10:55:02 +0000 (11:55 +0100)
Honestly I'm rather surprised that I typed the right number of zeroes.

plugins/tracklength-gstreamer.c

index 0d37a09..7297eae 100644 (file)
@@ -72,7 +72,7 @@ long disorder_tracklength(const char UNUSED *track, const char *path) {
   switch(gst_discoverer_info_get_result(info)) {
   case GST_DISCOVERER_OK:
     t = gst_discoverer_info_get_duration(info);
-    length = (t + 500000000)/1000000000;
+    length = (t + GST_SECOND/2)/GST_SECOND;
     break;
   case GST_DISCOVERER_TIMEOUT:
     disorder_info("discovery timed out probing `%s'", path);