avidemux: Also detect 0x000001 as H264 byte-stream start code in codec_data
This works around some AVI files storing byte-stream data in the codec_data. The previous workaround was only checking for 0x00000001 (4 bytes) instead of 0x000001 (3 bytes). Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/1072>
This commit is contained in:
parent
ab6cb4c2c7
commit
fedd6c2a28
@ -1968,10 +1968,7 @@ gst_avi_demux_check_caps (GstAviDemux * avi, GstAviStream * stream,
|
||||
gst_structure_remove_field (s, "palette_data");
|
||||
return caps;
|
||||
}
|
||||
} else if (!gst_structure_has_name (s, "video/x-h264")) {
|
||||
return caps;
|
||||
}
|
||||
|
||||
} else if (gst_structure_has_name (s, "video/x-h264")) {
|
||||
GST_DEBUG_OBJECT (avi, "checking caps %" GST_PTR_FORMAT, caps);
|
||||
|
||||
/* some muxers put invalid bytestream stuff in h264 extra data */
|
||||
@ -1986,8 +1983,9 @@ gst_avi_demux_check_caps (GstAviDemux * avi, GstAviStream * stream,
|
||||
size = map.size;
|
||||
if (size >= 4) {
|
||||
guint32 h = GST_READ_UINT32_BE (data);
|
||||
|
||||
gst_buffer_unmap (buf, &map);
|
||||
if (h == 0x01) {
|
||||
if (h == 0x01 || (h >> 8) == 0x01) {
|
||||
/* can hardly be valid AVC codec data */
|
||||
GST_DEBUG_OBJECT (avi,
|
||||
"discarding invalid codec_data containing byte-stream");
|
||||
@ -2001,6 +1999,7 @@ gst_avi_demux_check_caps (GstAviDemux * avi, GstAviStream * stream,
|
||||
gst_buffer_unmap (buf, &map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return caps;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user