Commit 155614be authored by Laurent Aimar's avatar Laurent Aimar

Fixed a big rtp demuxer.

DEMUX_GET_PTS_DELAY should returns microsecond.

You should NOT remove caching to PTS to create PCR.
It was probably a workaround for the previous bug. It could explains
the problems with TS over RTP (for TS with small pcr/pts delay that is, not
created by VLC)

Implemented missing DEMUX_CAN_* query.
parent 8fab2070
...@@ -334,7 +334,7 @@ static int Control (demux_t *demux, int i_query, va_list args) ...@@ -334,7 +334,7 @@ static int Control (demux_t *demux, int i_query, va_list args)
{ {
float *v = va_arg (args, float *); float *v = va_arg (args, float *);
*v = 0.; *v = 0.;
return 0; return VLC_SUCCESS;
} }
case DEMUX_GET_LENGTH: case DEMUX_GET_LENGTH:
...@@ -342,14 +342,23 @@ static int Control (demux_t *demux, int i_query, va_list args) ...@@ -342,14 +342,23 @@ static int Control (demux_t *demux, int i_query, va_list args)
{ {
int64_t *v = va_arg (args, int64_t *); int64_t *v = va_arg (args, int64_t *);
*v = 0; *v = 0;
return 0; return VLC_SUCCESS;
} }
case DEMUX_GET_PTS_DELAY: case DEMUX_GET_PTS_DELAY:
{ {
int64_t *v = va_arg (args, int64_t *); int64_t *v = va_arg (args, int64_t *);
*v = p_sys->caching; *v = p_sys->caching * 1000;
return 0; return VLC_SUCCESS;
}
case DEMUX_CAN_PAUSE:
case DEMUX_CAN_SEEK:
case DEMUX_CAN_CONTROL_PACE:
{
bool *v = (bool*)va_arg( args, bool * );
*v = false;
return VLC_SUCCESS;
} }
} }
...@@ -453,8 +462,7 @@ static void codec_decode (demux_t *demux, void *data, block_t *block) ...@@ -453,8 +462,7 @@ static void codec_decode (demux_t *demux, void *data, block_t *block)
if (data) if (data)
{ {
block->i_dts = 0; /* RTP does not specify this */ block->i_dts = 0; /* RTP does not specify this */
es_out_Control (demux->out, ES_OUT_SET_PCR, es_out_Control (demux->out, ES_OUT_SET_PCR, block->i_pts );
block->i_pts - demux->p_sys->caching * 1000);
es_out_Send (demux->out, (es_out_id_t *)data, block); es_out_Send (demux->out, (es_out_id_t *)data, block);
} }
else else
......
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