Commit 05183675 authored by Robert Krakora's avatar Robert Krakora Committed by Tim-Philipp Müller

uvch264src: don't error out on incomplete aux data segment

It appears that the Logitech C920 sometimes drops the next
to last segment of RAW aux data contained within the MJPEG
container.  H264 data that is multiplexed with in the same
container does not appear to be affected.  This appears to
be a bug in the Logitech C920 firmware and uvch264src should
not error out in this case.

Sometimes it can take 24 hours of continuous streaming for
the problem to occur, but sometimes it takes only a couple
of hours.

https://bugzilla.gnome.org/show_bug.cgi?id=706276
parent 7d5b8e37
......@@ -473,6 +473,7 @@ gst_uvc_h264_mjpg_demux_chain (GstPad * pad, GstBuffer * buf)
guint i;
guchar *data;
guint size;
guint16 segment_size = 0;
self = GST_UVC_H264_MJPG_DEMUX (GST_PAD_PARENT (pad));
......@@ -488,7 +489,6 @@ gst_uvc_h264_mjpg_demux_chain (GstPad * pad, GstBuffer * buf)
for (i = 0; i < size - 1; i++) {
/* Check for APP4 (0xe4) marker in the jpeg */
if (data[i] == 0xff && data[i + 1] == 0xe4) {
guint16 segment_size;
/* Sanity check sizes and get segment size */
if (i + 4 >= size) {
......@@ -683,9 +683,10 @@ gst_uvc_h264_mjpg_demux_chain (GstPad * pad, GstBuffer * buf)
jpeg_it = NULL;
if (aux_buf != NULL) {
GST_ELEMENT_ERROR (self, STREAM, DEMUX,
("Incomplete auxiliary stream. %d bytes missing", aux_size), (NULL));
ret = GST_FLOW_ERROR;
GST_DEBUG_OBJECT (self, "Incomplete auxiliary stream: %d bytes missing, "
"%d segment size remaining -- missing segment, C920 bug?",
aux_size, segment_size);
ret = GST_FLOW_OK;
goto done;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment