Commit 62c2a106 authored by massiot's avatar massiot

* output.c: Avoid jitter in RTP timestamps, patch by Marian Ďurkovič.


git-svn-id: svn://svn.videolan.org/dvblast/trunk@20 55d3f8b6-4a41-4d2d-a900-313d1436a5b8
parent 9424fc16
......@@ -225,7 +225,7 @@ static void demux_Handle( block_t *p_ts )
if ( pp_outputs[j]->i_sid == i_sid )
{
pp_outputs[j]->i_ref_timestamp = i_timestamp;
pp_outputs[j]->i_ref_wallclock = i_wallclock;
pp_outputs[j]->i_ref_wallclock = 0;
}
}
}
......
......@@ -95,7 +95,7 @@ int output_Init( output_t *p_output, in_addr_t i_maddr, uint16_t i_port )
p_output->p_pmt_section = NULL;
p_output->p_sdt_section = NULL;
p_output->i_ref_timestamp = 0;
p_output->i_ref_wallclock = mdate();
p_output->i_ref_wallclock = 0;
p_output->i_maddr = i_maddr;
p_output->i_port = i_port;
......@@ -244,8 +244,18 @@ static int net_Open( output_t *p_output )
static void rtp_SetHdr( output_t *p_output, uint8_t *p_hdr )
{
mtime_t i_timestamp = p_output->i_ref_timestamp
+ (mdate() - p_output->i_ref_wallclock) * 9 / 100;
mtime_t i_timestamp;
if (!p_output->i_ref_wallclock)
{
i_timestamp = p_output->i_ref_timestamp;
p_output->i_ref_wallclock = mdate();
}
else
{
i_timestamp = p_output->i_ref_timestamp
+ (mdate() - p_output->i_ref_wallclock) * 9 / 100;
}
p_hdr[0] = 0x80;
p_hdr[1] = 33;
......
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