[vlc-commits] textst: use MPEG timestamp macros

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri May 11 07:49:37 2018 +0200| [3340f73b1862643860e8184083da2ead2178370b] | committer: Steve Lhomme

textst: use MPEG timestamp macros

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

 modules/codec/Makefile.am | 2 +-
 modules/codec/textst.c    | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index b7e1cd2dc5..209eaf829a 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -265,7 +265,7 @@ libtelx_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 EXTRA_LTLIBRARIES += libtelx_plugin.la
 codec_LTLIBRARIES += $(LTLIBtelx)
 
-libtextst_plugin_la_SOURCES = codec/textst.c
+libtextst_plugin_la_SOURCES = codec/textst.c demux/mpeg/timestamps.h
 libtextst_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(codecdir)'
 codec_LTLIBRARIES += libtextst_plugin.la
 
diff --git a/modules/codec/textst.c b/modules/codec/textst.c
index 0799bce488..5c65ec4ea8 100644
--- a/modules/codec/textst.c
+++ b/modules/codec/textst.c
@@ -32,6 +32,8 @@
 #include <vlc_plugin.h>
 #include <vlc_codec.h>
 
+#include "../demux/mpeg/timestamps.h"
+
 #include "substext.h"
 
 /*****************************************************************************
@@ -235,10 +237,8 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
         (p_block->i_flags & BLOCK_FLAG_CORRUPTED) == 0 &&
         (p_sub = decoder_NewSubpictureText(p_dec)))
     {
-        p_sub->i_start = ((int64_t) (p_block->p_buffer[3] & 0x01) << 32) | GetDWBE(&p_block->p_buffer[4]);
-        p_sub->i_stop = ((int64_t) (p_block->p_buffer[8] & 0x01) << 32) | GetDWBE(&p_block->p_buffer[9]);
-        p_sub->i_start = VLC_TICK_0 + p_sub->i_start * 100 / 9;
-        p_sub->i_stop = VLC_TICK_0 + p_sub->i_stop * 100 / 9;
+        p_sub->i_start = FROM_SCALE((int64_t)((p_block->p_buffer[3] & 0x01) << 32) | GetDWBE(&p_block->p_buffer[4]));
+        p_sub->i_stop = FROM_SCALE((int64_t)((p_block->p_buffer[8] & 0x01) << 32) | GetDWBE(&p_block->p_buffer[9]));
         if (p_sub->i_start < p_block->i_dts)
         {
             p_sub->i_stop += p_block->i_dts - p_sub->i_start;



More information about the vlc-commits mailing list