mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 11:29:55 +00:00
baseparse: simplify code a bit
Avoid repeated checks for testing if a buffer is a header
This commit is contained in:
parent
288280fb0c
commit
921816400b
1 changed files with 14 additions and 12 deletions
|
@ -980,19 +980,21 @@ static GstFlowReturn
|
||||||
gst_base_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
gst_base_parse_parse_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer = frame->buffer;
|
GstBuffer *buffer = frame->buffer;
|
||||||
gboolean is_header = GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER);
|
|
||||||
|
|
||||||
if (!GST_BUFFER_PTS_IS_VALID (buffer) && !is_header &&
|
/* Avoid updating timestamps of header buffers */
|
||||||
GST_CLOCK_TIME_IS_VALID (parse->priv->next_pts)) {
|
if (!GST_BUFFER_FLAG_IS_SET (buffer, GST_BUFFER_FLAG_HEADER)) {
|
||||||
GST_BUFFER_PTS (buffer) = parse->priv->next_pts;
|
if (!GST_BUFFER_PTS_IS_VALID (buffer) &&
|
||||||
}
|
GST_CLOCK_TIME_IS_VALID (parse->priv->next_pts)) {
|
||||||
if (!GST_BUFFER_DTS_IS_VALID (buffer) && !is_header &&
|
GST_BUFFER_PTS (buffer) = parse->priv->next_pts;
|
||||||
GST_CLOCK_TIME_IS_VALID (parse->priv->next_dts)) {
|
}
|
||||||
GST_BUFFER_DTS (buffer) = parse->priv->next_dts;
|
if (!GST_BUFFER_DTS_IS_VALID (buffer) &&
|
||||||
}
|
GST_CLOCK_TIME_IS_VALID (parse->priv->next_dts)) {
|
||||||
if (!GST_BUFFER_DURATION_IS_VALID (buffer) && !is_header &&
|
GST_BUFFER_DTS (buffer) = parse->priv->next_dts;
|
||||||
GST_CLOCK_TIME_IS_VALID (parse->priv->frame_duration)) {
|
}
|
||||||
GST_BUFFER_DURATION (buffer) = parse->priv->frame_duration;
|
if (!GST_BUFFER_DURATION_IS_VALID (buffer) &&
|
||||||
|
GST_CLOCK_TIME_IS_VALID (parse->priv->frame_duration)) {
|
||||||
|
GST_BUFFER_DURATION (buffer) = parse->priv->frame_duration;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue