Commit 8cabcc78 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

TY: housekeeping...

parent 674ed509
......@@ -634,7 +634,7 @@ static int check_sync_pes( demux_t *p_demux, block_t *p_block,
if (p_sys->firstAudioPTS < 0)
p_sys->firstAudioPTS = p_sys->lastAudioPTS;
p_block->i_pts = p_sys->lastAudioPTS;
/*msg_Dbg(p_demux, "Audio PTS %lld", p_sys->lastAudioPTS );*/
/*msg_Dbg(p_demux, "Audio PTS %"PRId64, p_sys->lastAudioPTS );*/
/* adjust audio record to remove PES header */
memmove(p_block->p_buffer + offset, p_block->p_buffer + offset +
p_sys->i_Pes_Length, rec_len - p_sys->i_Pes_Length);
......@@ -918,8 +918,7 @@ static int DemuxRecAudio( demux_t *p_demux, ty_rec_hdr_t *rec_hdr, block_t *p_bl
block_Release(p_block_in);
return 0;
/*msg_Dbg(p_demux, "SA Audio PTS %lld",
p_sys->lastAudioPTS );*/
/*msg_Dbg(p_demux, "SA Audio PTS %"PRId64, p_sys->lastAudioPTS );*/
}
/* DTiVo Audio with PES Header */
/* ================================================ */
......@@ -1044,8 +1043,7 @@ static int ty_stream_seek_pct(demux_t *p_demux, double seek_pct)
{
demux_sys_t *p_sys = p_demux->p_sys;
int64_t seek_pos = p_sys->i_stream_size * seek_pct;
long l_skip_amt;
int i;
uint64_t l_skip_amt;
unsigned i_cur_part;
/* if we're not seekable, there's nothing to do */
......@@ -1084,7 +1082,7 @@ static int ty_stream_seek_pct(demux_t *p_demux, double seek_pct)
/* seek to the start of this record's data.
* to do that, we have to skip past all prior records */
l_skip_amt = 0;
for (i=0; i<p_sys->i_cur_rec; i++)
for ( int i=0; i<p_sys->i_cur_rec; i++)
l_skip_amt += p_sys->rec_hdrs[i].l_rec_size;
stream_Seek(p_demux->s, ((p_sys->i_cur_chunk-1) * CHUNK_SIZE) +
(p_sys->i_num_recs * 16) + l_skip_amt + 4);
......@@ -1098,15 +1096,13 @@ static int ty_stream_seek_pct(demux_t *p_demux, double seek_pct)
//#define TY_XDS_DEBUG
static void XdsInit( xds_t *h )
{
int i, j;
h->b_xds = false;
h->i_class = XDS_MAX_CLASS_COUNT;
h->i_type = 0;
h->b_future = false;
for( i = 0; i < XDS_MAX_CLASS_COUNT; i++ )
for( int i = 0; i < XDS_MAX_CLASS_COUNT; i++ )
{
for( j = 0; j < 128; j++ )
for( int j = 0; j < 128; j++ )
h->pkt[i][j].b_started = false;
}
h->b_meta_changed = false;
......@@ -1128,10 +1124,8 @@ static void XdsExit( xds_t *h )
}
static void XdsStringUtf8( char dst[2*32+1], const uint8_t *p_src, int i_src )
{
int i;
int i_dst;
for( i = 0, i_dst = 0; i < i_src; i++ )
int i_dst = 0;
for( int i = 0; i < i_src; i++ )
{
switch( p_src[i] )
{
......@@ -1466,19 +1460,19 @@ static void DemuxDecodeXds( demux_t *p_demux, uint8_t d1, uint8_t d2 )
static int ty_stream_seek_time(demux_t *p_demux, uint64_t l_seek_time)
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_seq_entry = 0;
int i_skip_cnt;
unsigned i_seq_entry = 0;
unsigned i;
long l_cur_pos = stream_Tell(p_demux->s);
int i_skip_cnt;
int64_t l_cur_pos = stream_Tell(p_demux->s);
unsigned i_cur_part = l_cur_pos / TIVO_PART_LENGTH;
long l_seek_secs = l_seek_time / 1000000000;
uint64_t l_seek_secs = l_seek_time / 1000000000;
uint64_t l_fwd_stamp = 1;
/* if we're not seekable, there's nothing to do */
if (!p_sys->b_seekable || !p_sys->b_have_master)
return VLC_EGENERIC;
msg_Dbg(p_demux, "Skipping to time %02ld:%02ld:%02ld",
msg_Dbg(p_demux, "Skipping to time %02"PRIu64":%02"PRIu64":%02"PRIu64,
l_seek_secs / 3600, (l_seek_secs / 60) % 60, l_seek_secs % 60);
/* seek to the proper segment if necessary */
......@@ -1542,15 +1536,15 @@ static int ty_stream_seek_time(demux_t *p_demux, uint64_t l_seek_time)
}
/* determine which chunk has our seek_time */
for (i=0; i<p_sys->i_bits_per_seq_entry; i++) {
long l_chunk_nr = i_seq_entry * p_sys->i_bits_per_seq_entry + i;
long l_chunk_offset = (l_chunk_nr + 1) * CHUNK_SIZE;
msg_Dbg(p_demux, "testing part %d chunk %ld mask 0x%02X bit %d",
for (unsigned i=0; i<p_sys->i_bits_per_seq_entry; i++) {
uint64_t l_chunk_nr = i_seq_entry * p_sys->i_bits_per_seq_entry + i;
uint64_t l_chunk_offset = (l_chunk_nr + 1) * CHUNK_SIZE;
msg_Dbg(p_demux, "testing part %d chunk %"PRIu64" mask 0x%02X bit %d",
i_cur_part, l_chunk_nr,
p_sys->seq_table[i_seq_entry].chunk_bitmask[i/8], i%8);
if (p_sys->seq_table[i_seq_entry].chunk_bitmask[i/8] & (1 << (i%8))) {
/* check this chunk's SEQ header timestamp */
msg_Dbg(p_demux, "has SEQ. seeking to chunk at 0x%lX",
msg_Dbg(p_demux, "has SEQ. seeking to chunk at 0x%"PRIu64,
(i_cur_part * TIVO_PART_LENGTH) + l_chunk_offset);
stream_Seek(p_demux->s, (i_cur_part * TIVO_PART_LENGTH) +
l_chunk_offset);
......@@ -1569,7 +1563,7 @@ static int ty_stream_seek_time(demux_t *p_demux, uint64_t l_seek_time)
}
l_seek_secs = p_sys->rec_hdrs[p_sys->i_seq_rec].l_ty_pts /
1000000000;
msg_Dbg(p_demux, "found SEQ hdr for timestamp %02ld:%02ld:%02ld",
msg_Dbg(p_demux, "found SEQ hdr for timestamp %02"PRIu64":%02"PRIu64":%02"PRIu64,
l_seek_secs / 3600,
(l_seek_secs / 60) % 60, l_seek_secs % 60);
if (p_sys->rec_hdrs[p_sys->i_seq_rec].l_ty_pts >= l_seek_time) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment