]> git.sesse.net Git - nageru/blobdiff - clip_list.cpp
Read timebase from the input video.
[nageru] / clip_list.cpp
index 09fe0348e3ff8dc81e7d8e301b7e00979c62743f..75f4a9f46b6be66e0f72523528600262aab20350 100644 (file)
@@ -5,14 +5,14 @@
 #include <vector>
 
 #include "clip_list.h"
+#include "timebase.h"
 #include "ui_mainwindow.h"
 
 using namespace std;
 
 string pts_to_string(int64_t pts)
 {
-       // FIXME: This depends on a fixed timebase.
-       int64_t t = lrint((pts / 12800.0) * 1e3);  // In milliseconds.
+       int64_t t = lrint((pts / double(TIMEBASE)) * 1e3);  // In milliseconds.
        int ms = t % 1000;
        t /= 1000;
        int sec = t % 60;
@@ -28,8 +28,7 @@ string pts_to_string(int64_t pts)
 
 string duration_to_string(int64_t pts_diff)
 {
-       // FIXME: This depends on a fixed timebase.
-       int64_t t = lrint((pts_diff / 12800.0) * 1e3);  // In milliseconds.
+       int64_t t = lrint((pts_diff / double(TIMEBASE)) * 1e3);  // In milliseconds.
        int ms = t % 1000;
        t /= 1000;
        int sec = t % 60;