diff options
author | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2009-11-06 00:46:12 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.co.uk> | 2009-11-06 00:46:12 -0300 |
commit | fb9d7630e12c62218c6b4fbc3e143fd3153187f0 (patch) | |
tree | 45cc7fa3b6e9ccb1f2060313ecb9c25483733556 | |
parent | 892555955a0fc175768b7b684b5f00fb34496baf (diff) |
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
-rw-r--r-- | gst/qtmux/atoms.c | 10 | ||||
-rw-r--r-- | gst/qtmux/gstqtmux.c | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gst/qtmux/atoms.c b/gst/qtmux/atoms.c index 838b50f18..2f6909834 100644 --- a/gst/qtmux/atoms.c +++ b/gst/qtmux/atoms.c @@ -2425,9 +2425,13 @@ atom_trak_update_duration (AtomTRAK * trak, guint64 moov_timescale) { trak->mdia.mdhd.time_info.duration = atom_stts_get_total_duration (&trak->mdia.minf.stbl.stts); - trak->tkhd.duration = - gst_util_uint64_scale (trak->mdia.mdhd.time_info.duration, moov_timescale, - trak->mdia.mdhd.time_info.timescale); + if (trak->mdia.mdhd.time_info.timescale != 0) { + trak->tkhd.duration = + gst_util_uint64_scale (trak->mdia.mdhd.time_info.duration, + moov_timescale, trak->mdia.mdhd.time_info.timescale); + } else { + trak->tkhd.duration = 0; + } } static guint32 diff --git a/gst/qtmux/gstqtmux.c b/gst/qtmux/gstqtmux.c index b52b87170..41ea97f7a 100644 --- a/gst/qtmux/gstqtmux.c +++ b/gst/qtmux/gstqtmux.c @@ -1126,7 +1126,7 @@ gst_qt_mux_stop_file (GstQTMux * qtmux) GST_PAD_NAME (qtpad->collect.pad)); ret = gst_qt_mux_add_buffer (qtmux, qtpad, NULL); 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), gst_flow_get_name (ret)); } @@ -1405,7 +1405,8 @@ not_negotiated: GST_ELEMENT_ERROR (qtmux, CORE, NEGOTIATION, (NULL), ("format wasn't negotiated before buffer flow on pad %s", GST_PAD_NAME (pad->collect.pad))); - gst_buffer_unref (buf); + if (buf) + gst_buffer_unref (buf); return GST_FLOW_NOT_NEGOTIATED; } } |