mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
rtpasfdepay: avoid re-sending header
... e.g. following a seek, which otherwise confuses downstream demuxer expecting only a flow of data packets at this time.
This commit is contained in:
parent
81f62a987a
commit
4f2627e737
1 changed files with 21 additions and 1 deletions
|
@ -157,7 +157,17 @@ gst_rtp_asf_depay_setcaps (GstBaseRTPDepayload * depayload, GstCaps * caps)
|
||||||
if (ps_string == NULL || *ps_string == '\0')
|
if (ps_string == NULL || *ps_string == '\0')
|
||||||
goto no_packetsize;
|
goto no_packetsize;
|
||||||
|
|
||||||
depay->packet_size = atoi (ps_string);
|
if (depay->packet_size) {
|
||||||
|
/* header sent again following seek;
|
||||||
|
* discard to avoid confusing upstream */
|
||||||
|
if (depay->packet_size == atoi (ps_string)) {
|
||||||
|
goto duplicate_header;
|
||||||
|
} else {
|
||||||
|
/* since we should fiddle with downstream state to handle this */
|
||||||
|
goto refuse_renegotiation;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
depay->packet_size = atoi (ps_string);
|
||||||
if (depay->packet_size <= 16)
|
if (depay->packet_size <= 16)
|
||||||
goto invalid_packetsize;
|
goto invalid_packetsize;
|
||||||
|
|
||||||
|
@ -203,6 +213,16 @@ invalid_headers:
|
||||||
g_free (headers);
|
g_free (headers);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
duplicate_header:
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (depayload, "discarding duplicate header");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
refuse_renegotiation:
|
||||||
|
{
|
||||||
|
GST_WARNING_OBJECT (depayload, "cannot renegotiate to different header");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
static gint
|
||||||
|
|
Loading…
Reference in a new issue