[vlc-commits] svcdsub: use MPEG timestamp macros
Steve Lhomme
git at videolan.org
Tue Sep 18 14:30:39 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri May 11 07:42:20 2018 +0200| [a012f1f9cf443af6b17d73d94e9cf25590e3cba3] | committer: Steve Lhomme
svcdsub: use MPEG timestamp macros
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a012f1f9cf443af6b17d73d94e9cf25590e3cba3
---
modules/codec/Makefile.am | 2 +-
modules/codec/svcdsub.c | 7 +++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/modules/codec/Makefile.am b/modules/codec/Makefile.am
index 97aef7205f..b7e1cd2dc5 100644
--- a/modules/codec/Makefile.am
+++ b/modules/codec/Makefile.am
@@ -252,7 +252,7 @@ libwebvtt_plugin_la_SOURCES += codec/webvtt/CSSGrammar.y \
codec/webvtt/css_bridge.h
endif
-libsvcdsub_plugin_la_SOURCES = codec/svcdsub.c
+libsvcdsub_plugin_la_SOURCES = codec/svcdsub.c demux/mpeg/timestamps.h
codec_LTLIBRARIES += libsvcdsub_plugin.la
libt140_plugin_la_SOURCES = codec/t140.c
diff --git a/modules/codec/svcdsub.c b/modules/codec/svcdsub.c
index 3fcb0528ad..3c35c0751d 100644
--- a/modules/codec/svcdsub.c
+++ b/modules/codec/svcdsub.c
@@ -36,6 +36,8 @@
#include <vlc_codec.h>
#include <vlc_bits.h>
+#include "../demux/mpeg/timestamps.h"
+
/*****************************************************************************
* Module descriptor.
*****************************************************************************/
@@ -71,8 +73,6 @@ static void SVCDSubRenderImage( decoder_t *, block_t *, subpicture_region_t * );
#define GETINT16(p) GetWBE(p) ; p +=2;
-#define GETINT32(p) GetDWBE(p) ; p += 4;
-
typedef enum {
SUBTITLE_BLOCK_EMPTY = 0,
SUBTITLE_BLOCK_PARTIAL = 1,
@@ -375,9 +375,8 @@ static void ParseHeader( decoder_t *p_dec, block_t *p_block )
// Skip over unused value
p++;
- if( i_options & 0x08 ) { p_sys->i_duration = GETINT32(p); }
+ if( i_options & 0x08 ) { p_sys->i_duration = FROM_SCALE_NZ(GetDWBE(p)); p += 4; }
else p_sys->i_duration = 0; /* Ephemer subtitle */
- p_sys->i_duration *= 100 / 9;
p_sys->i_x_start = GETINT16(p);
p_sys->i_y_start = GETINT16(p);
More information about the vlc-commits
mailing list