Browse Source

demux: ty: use MPEG timestamp macros

pull/72/head
Steve Lhomme 8 years ago
parent
commit
1619fb2d02
  1. 3
      modules/demux/Makefile.am
  2. 13
      modules/demux/ty.c

3
modules/demux/Makefile.am

@ -64,7 +64,8 @@ libsubtitle_plugin_la_SOURCES = demux/subtitle.c
libsubtitle_plugin_la_LIBADD = $(LIBM)
demux_LTLIBRARIES += libsubtitle_plugin.la
libty_plugin_la_SOURCES = demux/ty.c codec/cc.h
libty_plugin_la_SOURCES = demux/ty.c codec/cc.h \
demux/mpeg/pes.h demux/mpeg/timestamps.h
demux_LTLIBRARIES += libty_plugin.la
libvobsub_plugin_la_SOURCES = demux/vobsub.c demux/vobsub.h \

13
modules/demux/ty.c

@ -47,6 +47,8 @@
#include <vlc_input.h>
#include "../codec/cc.h"
#include "mpeg/pes.h"
#include <assert.h>
/*****************************************************************************
@ -563,15 +565,8 @@ static void Close( vlc_object_t *p_this )
* Assume buf points to beginning of PTS */
static vlc_tick_t get_pts( const uint8_t *buf )
{
vlc_tick_t i_pts;
i_pts = ((vlc_tick_t)(buf[0]&0x0e ) << 29)|
(vlc_tick_t)(buf[1] << 22)|
((vlc_tick_t)(buf[2]&0xfe) << 14)|
(vlc_tick_t)(buf[3] << 7)|
(vlc_tick_t)(buf[4] >> 1);
i_pts *= 100 / 9; /* convert PTS (90Khz clock) to microseconds */
return i_pts;
stime_t i_pts = GetPESTimestamp( buf );
return FROM_SCALE_NZ(i_pts); /* convert PTS (90Khz clock) to microseconds */
}

Loading…
Cancel
Save