#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
-#include "vlc_codec.h"
-#include "vlc_meta.h"
-#include "vlc_input.h"
+#include <vlc_codec.h>
+#include <vlc_meta.h>
+#include <vlc_input.h>
#include "../codec/cc.h"
#include <assert.h>
* Something must be wrong.
*/
set_callbacks( Open, Close )
- add_shortcut("ty")
- add_shortcut("tivo")
+ add_shortcut("ty", "tivo")
vlc_module_end ()
/*****************************************************************************
p_sys->b_first_chunk = true;
p_sys->b_have_master = (U32_AT(p_peek) == TIVO_PES_FILEID);
p_sys->firstAudioPTS = -1;
+ p_sys->lastAudioPTS = VLC_TS_INVALID;
+ p_sys->lastVideoPTS = VLC_TS_INVALID;
p_sys->i_stream_size = stream_Size(p_demux->s);
p_sys->tivo_type = TIVO_TYPE_UNKNOWN;
p_sys->audio_type = TIVO_AUDIO_UNKNOWN;
/* set these as 'unknown' for now */
p_block_in->i_pts =
- p_block_in->i_dts = 0;
+ p_block_in->i_dts = VLC_TS_INVALID;
}
/*else
{
if( offset < 0 )
{
/* no header found, fake some 00's (this works, believe me) */
- memset( p_sys->pes_buffer, 4, 0 );
+ memset( p_sys->pes_buffer, 0, 4 );
p_sys->i_pes_buf_cnt = 4;
if( rec_len > 4 )
msg_Err( p_demux, "PES header not found in record of %d bytes!",
return -1; /* partial PES, no audio data */
}
/* full PES header present, extract PTS */
- p_sys->lastAudioPTS = get_pts( &p_block->p_buffer[ offset +
- p_sys->i_Pts_Offset ] );
+ p_sys->lastAudioPTS = VLC_TS_0 + get_pts( &p_block->p_buffer[ offset +
+ p_sys->i_Pts_Offset ] );
if (p_sys->firstAudioPTS < 0)
p_sys->firstAudioPTS = p_sys->lastAudioPTS;
p_block->i_pts = p_sys->lastAudioPTS;
{
//msg_Dbg(p_demux, "Video PES hdr in pkt type 0x%02x at offset %d",
//subrec_type, esOffset1);
- p_sys->lastVideoPTS = get_pts(
+ p_sys->lastVideoPTS = VLC_TS_0 + get_pts(
&p_block_in->p_buffer[ esOffset1 + VIDEO_PTS_OFFSET ] );
/*msg_Dbg(p_demux, "Video rec %d PTS %"PRId64, p_sys->i_cur_rec,
p_sys->lastVideoPTS );*/
//p_sys->l_last_ty_pts += 33366667;
}
/* set PTS for this block before we send */
- if (p_sys->lastVideoPTS > 0)
+ if (p_sys->lastVideoPTS > VLC_TS_INVALID)
{
p_block_in->i_pts = p_sys->lastVideoPTS;
/* PTS gets used ONCE.
* Any subsequent frames we get BEFORE next PES
* header will have their PTS computed in the codec */
- p_sys->lastVideoPTS = 0;
+ p_sys->lastVideoPTS = VLC_TS_INVALID;
}
}
}
/* Send the CC data */
- if( p_block_in->i_pts > 0 && p_sys->cc.i_data > 0 )
+ if( p_block_in->i_pts > VLC_TS_INVALID && p_sys->cc.i_data > 0 )
{
for( i = 0; i < 4; i++ )
{
}
else
{
- p_sys->lastAudioPTS = get_pts(
+ p_sys->lastAudioPTS = VLC_TS_0 + get_pts(
&p_sys->pes_buffer[ esOffset1 + p_sys->i_Pts_Offset ] );
p_block_in->i_pts = p_sys->lastAudioPTS;
}
/* ================================================ */
if ( ( esOffset1 == 0 ) && ( l_rec_size == 16 ) )
{
- p_sys->lastAudioPTS = get_pts( &p_block_in->p_buffer[
+ p_sys->lastAudioPTS = VLC_TS_0 + get_pts( &p_block_in->p_buffer[
SA_PTS_OFFSET ] );
if (p_sys->firstAudioPTS < 0)
p_sys->firstAudioPTS = p_sys->lastAudioPTS;
/*msg_Dbg(p_demux,
"Adding SA Audio Packet Size %ld", l_rec_size ); */
- if (p_sys->lastAudioPTS > 0)
+ if (p_sys->lastAudioPTS > VLC_TS_INVALID )
p_block_in->i_pts = p_sys->lastAudioPTS;
}
else if( subrec_type == 0x09 )
}
/* set PCR before we send (if PTS found) */
- if( p_block_in->i_pts > 0 )
+ if( p_block_in->i_pts > VLC_TS_INVALID )
es_out_Control( p_demux->out, ES_OUT_SET_PCR,
p_block_in->i_pts );
/* Send data */
(p_sys->i_num_recs * 16) + l_skip_amt + 4);
/* to hell with syncing any audio or video, just start reading records... :) */
- /*p_sys->lastAudioPTS = p_sys->lastVideoPTS = 0;*/
+ /*p_sys->lastAudioPTS = p_sys->lastVideoPTS = VLC_TS_INVALID;*/
return VLC_SUCCESS;
}