qtmux: Don't unconditionally use strnlen()

It's not available on older OSX and we can as well use memchr() here.

https://bugzilla.gnome.org/show_bug.cgi?id=756154
This commit is contained in:
Ryan Hendrickson 2015-10-19 15:36:37 +03:00 committed by Sebastian Dröge
parent 0cefb6722b
commit fc203a4bd7

View file

@ -694,6 +694,7 @@ gst_qt_mux_prepare_tx3g_buffer (GstQTPad * qtpad, GstBuffer * buf,
GstMapInfo frommap;
GstMapInfo tomap;
gsize size;
const guint8 *dataend;
GST_LOG_OBJECT (qtmux, "Preparing tx3g buffer %" GST_PTR_FORMAT, buf);
@ -702,7 +703,8 @@ gst_qt_mux_prepare_tx3g_buffer (GstQTPad * qtpad, GstBuffer * buf,
gst_buffer_map (buf, &frommap, GST_MAP_READ);
size = (gint16) strnlen ((const char *) frommap.data, frommap.size);
dataend = memchr (frommap.data, 0, frommap.size);
size = dataend ? dataend - frommap.data : frommap.size;
newbuf = gst_buffer_new_and_alloc (size + 2);
gst_buffer_map (newbuf, &tomap, GST_MAP_WRITE);