Commit 5a8a8baa authored by François Cartegnie's avatar François Cartegnie 🤞

Revert "access: rtp: handle drops for discontinuity propagation"

This reverts commit 079eaa8c.
parent e15a5753
......@@ -438,7 +438,7 @@ void codec_destroy (demux_t *demux, void *data)
}
/* Send a packet to decoder */
bool codec_decode (demux_t *demux, void *data, block_t *block)
void codec_decode (demux_t *demux, void *data, block_t *block)
{
if (data)
{
......@@ -448,7 +448,6 @@ bool codec_decode (demux_t *demux, void *data, block_t *block)
}
else
block_Release (block);
return !!data;
}
static void *stream_init (demux_t *demux, const char *name)
......@@ -484,14 +483,13 @@ static void stream_header (demux_t *demux, void *data, block_t *block)
}
/* Send a packet to a chained demuxer */
static bool stream_decode (demux_t *demux, void *data, block_t *block)
static void stream_decode (demux_t *demux, void *data, block_t *block)
{
VLC_UNUSED(demux);
if (data)
vlc_demux_chained_Send(data, block);
else
block_Release (block);
return !!data;
(void)demux;
}
static void *demux_init (demux_t *demux)
......@@ -591,18 +589,18 @@ static void *mpa_init (demux_t *demux)
return codec_init (demux, &fmt);
}
static bool mpa_decode (demux_t *demux, void *data, block_t *block)
static void mpa_decode (demux_t *demux, void *data, block_t *block)
{
if (block->i_buffer < 4)
{
block_Release (block);
return false;
return;
}
block->i_buffer -= 4; /* 32-bits RTP/MPA header */
block->p_buffer += 4;
return codec_decode (demux, data, block);
codec_decode (demux, data, block);
}
......@@ -618,12 +616,12 @@ static void *mpv_init (demux_t *demux)
return codec_init (demux, &fmt);
}
static bool mpv_decode (demux_t *demux, void *data, block_t *block)
static void mpv_decode (demux_t *demux, void *data, block_t *block)
{
if (block->i_buffer < 4)
{
block_Release (block);
return false;
return;
}
block->i_buffer -= 4; /* 32-bits RTP/MPV header */
......@@ -635,7 +633,7 @@ static bool mpv_decode (demux_t *demux, void *data, block_t *block)
/* TODO: shouldn't we skip this too ? */
}
#endif
return codec_decode (demux, data, block);
codec_decode (demux, data, block);
}
......
......@@ -31,7 +31,7 @@ struct rtp_pt_t
void *(*init) (demux_t *);
void (*destroy) (demux_t *, void *);
void (*header) (demux_t *, void *, block_t *);
bool (*decode) (demux_t *, void *, block_t *);
void (*decode) (demux_t *, void *, block_t *);
uint32_t frequency; /* RTP clock rate (Hz) */
uint8_t number;
};
......@@ -44,11 +44,11 @@ static inline uint8_t rtp_ptype (const block_t *block)
void *codec_init (demux_t *demux, es_format_t *fmt);
void codec_destroy (demux_t *demux, void *data);
bool codec_decode (demux_t *demux, void *data, block_t *block);
void codec_decode (demux_t *demux, void *data, block_t *block);
void *theora_init (demux_t *demux);
void xiph_destroy (demux_t *demux, void *data);
bool xiph_decode (demux_t *demux, void *data, block_t *block);
void xiph_decode (demux_t *demux, void *data, block_t *block);
/** @section RTP session */
rtp_session_t *rtp_session_create (demux_t *);
......
......@@ -96,11 +96,10 @@ static void no_destroy (demux_t *demux, void *opaque)
(void)demux; (void)opaque;
}
static bool no_decode (demux_t *demux, void *opaque, block_t *block)
static void no_decode (demux_t *demux, void *opaque, block_t *block)
{
(void)demux; (void)opaque;
block_Release (block);
return true;
}
/**
......@@ -151,8 +150,6 @@ struct rtp_source_t
uint16_t last_seq; /* sequence of the next dequeued packet */
block_t *blocks; /* re-ordered blocks queue */
bool discontinuity;
void *opaque[]; /* Per-source private payload data */
};
......@@ -177,7 +174,6 @@ rtp_source_create (demux_t *demux, const rtp_session_t *session,
source->max_seq = source->bad_seq = init_seq;
source->last_seq = init_seq - 1;
source->blocks = NULL;
source->discontinuity = false;
/* Initializes all payload */
for (unsigned i = 0; i < session->ptc; i++)
......@@ -498,7 +494,6 @@ rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
uint16_t delta_seq = rtp_seq (block) - (src->last_seq + 1);
if (delta_seq != 0)
{
src->discontinuity = true;
if (delta_seq >= 0x8000)
{ /* Trash too late packets (and PIM Assert duplicates) */
msg_Dbg (demux, "ignoring late packet (sequence: %"PRIu16")",
......@@ -506,6 +501,7 @@ rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
goto drop;
}
msg_Warn (demux, "%"PRIu16" packet(s) lost", delta_seq);
block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
}
src->last_seq = rtp_seq (block);
......@@ -552,12 +548,7 @@ rtp_decode (demux_t *demux, const rtp_session_t *session, rtp_source_t *src)
block->p_buffer += skip;
block->i_buffer -= skip;
if(src->discontinuity)
block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
if (pt->decode (demux, pt_data, block))
src->discontinuity = false;
pt->decode (demux, pt_data, block);
return;
drop:
......
......@@ -143,10 +143,9 @@ static ssize_t xiph_header (void **pextra, const uint8_t *buf, size_t len)
}
bool xiph_decode (demux_t *demux, void *data, block_t *block)
void xiph_decode (demux_t *demux, void *data, block_t *block)
{
rtp_xiph_t *self = data;
bool ret = false;
if (!data || block->i_buffer < 4)
goto drop;
......@@ -206,14 +205,14 @@ bool xiph_decode (demux_t *demux, void *data, block_t *block)
if (!self->block)
{
block_Release (block);
return ret;
return;
}
memcpy (self->block->p_buffer + len, block->p_buffer + 2,
fraglen);
block_Release (block);
}
if (fragtype < 3)
return ret; /* Non-last fragment */
return; /* Non-last fragment */
/* Last fragment reached, process it */
block = self->block;
......@@ -248,8 +247,7 @@ bool xiph_decode (demux_t *demux, void *data, block_t *block)
block_t *raw = block_Alloc (len);
memcpy (raw->p_buffer, block->p_buffer, len);
raw->i_pts = block->i_pts; /* FIXME: what about pkts > 1 */
raw->i_flags |= (block->i_flags & BLOCK_FLAG_DISCONTINUITY);
ret |= codec_decode (demux, self->id, raw);
codec_decode (demux, self->id, raw);
break;
}
......@@ -276,7 +274,6 @@ bool xiph_decode (demux_t *demux, void *data, block_t *block)
ident);
self->ident = ident;
self->id = codec_init (demux, &fmt);
ret = true;
break;
}
}
......@@ -288,5 +285,4 @@ bool xiph_decode (demux_t *demux, void *data, block_t *block)
drop:
block_Release (block);
return ret;
}
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