[vlc-commits] qsv: use MPEG timestamp macros

Steve Lhomme git at videolan.org
Tue Sep 18 14:30:41 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu May 31 14:04:05 2018 +0200| [27ae8129e6a7708069be89d45589f7735d268ecc] | committer: Steve Lhomme

qsv: use MPEG timestamp macros

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=27ae8129e6a7708069be89d45589f7735d268ecc
---

 modules/codec/Makefile.am | 2 +-
 modules/codec/qsv.c       | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 209eaf829a..4dc2e498d2 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -589,7 +589,7 @@ libcrystalhd_plugin_la_LIBADD = $(LIBS_crystalhd)
 EXTRA_LTLIBRARIES += libcrystalhd_plugin.la
 codec_LTLIBRARIES += $(LTLIBcrystalhd)
 
-libqsv_plugin_la_SOURCES = codec/qsv.c codec/vlc_fifo_helper.h
+libqsv_plugin_la_SOURCES = codec/qsv.c codec/vlc_fifo_helper.h demux/mpeg/timestamps.h
 libqsv_plugin_la_CFLAGS = $(AM_CFLAGS) $(MFX_CFLAGS)
 libqsv_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 libqsv_plugin_la_LIBADD = $(MFX_LIBS)
diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c
index f8fb2e7e59..d2f37254c1 100644
--- a/modules/codec/qsv.c
+++ b/modules/codec/qsv.c
@@ -37,6 +37,7 @@
 #include <vlc_fifo_helper.h>
 
 #include <mfx/mfxvideo.h>
+#include "../demux/mpeg/timestamps.h"
 
 #define SOUT_CFG_PREFIX     "sout-qsv-"
 
@@ -304,12 +305,12 @@ static block_t *Encode(encoder_t *, picture_t *);
 
 static inline vlc_tick_t qsv_timestamp_to_mtime(int64_t mfx_ts)
 {
-    return mfx_ts / INT64_C(9) * INT64_C(100);
+    return FROM_SCALE_NZ(mfx_ts);
 }
 
 static inline uint64_t qsv_mtime_to_timestamp(vlc_tick_t vlc_ts)
 {
-    return vlc_ts / UINT64_C(100) * UINT64_C(9);
+    return TO_SCALE_NZ(vlc_ts);
 }
 
 static void clear_unused_frames(encoder_sys_t *sys)



More information about the vlc-commits mailing list