qtmux: Adding some ifs for protection
Adding somes ifs to protect against warning conditions that might happen when upstream element is not sane Fixes #600895
This commit is contained in:
parent
892555955a
commit
fb9d7630e1
@ -2425,9 +2425,13 @@ atom_trak_update_duration (AtomTRAK * trak, guint64 moov_timescale)
|
|||||||
{
|
{
|
||||||
trak->mdia.mdhd.time_info.duration =
|
trak->mdia.mdhd.time_info.duration =
|
||||||
atom_stts_get_total_duration (&trak->mdia.minf.stbl.stts);
|
atom_stts_get_total_duration (&trak->mdia.minf.stbl.stts);
|
||||||
|
if (trak->mdia.mdhd.time_info.timescale != 0) {
|
||||||
trak->tkhd.duration =
|
trak->tkhd.duration =
|
||||||
gst_util_uint64_scale (trak->mdia.mdhd.time_info.duration, moov_timescale,
|
gst_util_uint64_scale (trak->mdia.mdhd.time_info.duration,
|
||||||
trak->mdia.mdhd.time_info.timescale);
|
moov_timescale, trak->mdia.mdhd.time_info.timescale);
|
||||||
|
} else {
|
||||||
|
trak->tkhd.duration = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint32
|
static guint32
|
||||||
|
@ -1126,7 +1126,7 @@ gst_qt_mux_stop_file (GstQTMux * qtmux)
|
|||||||
GST_PAD_NAME (qtpad->collect.pad));
|
GST_PAD_NAME (qtpad->collect.pad));
|
||||||
ret = gst_qt_mux_add_buffer (qtmux, qtpad, NULL);
|
ret = gst_qt_mux_add_buffer (qtmux, qtpad, NULL);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
GST_DEBUG_OBJECT (qtmux, "Failed to send last buffer for %s, "
|
GST_WARNING_OBJECT (qtmux, "Failed to send last buffer for %s, "
|
||||||
"flow return: %s", GST_PAD_NAME (qtpad->collect.pad),
|
"flow return: %s", GST_PAD_NAME (qtpad->collect.pad),
|
||||||
gst_flow_get_name (ret));
|
gst_flow_get_name (ret));
|
||||||
}
|
}
|
||||||
@ -1405,6 +1405,7 @@ not_negotiated:
|
|||||||
GST_ELEMENT_ERROR (qtmux, CORE, NEGOTIATION, (NULL),
|
GST_ELEMENT_ERROR (qtmux, CORE, NEGOTIATION, (NULL),
|
||||||
("format wasn't negotiated before buffer flow on pad %s",
|
("format wasn't negotiated before buffer flow on pad %s",
|
||||||
GST_PAD_NAME (pad->collect.pad)));
|
GST_PAD_NAME (pad->collect.pad)));
|
||||||
|
if (buf)
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
return GST_FLOW_NOT_NEGOTIATED;
|
return GST_FLOW_NOT_NEGOTIATED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user