qtdemux: Don't parse fiel box a second time for JPEG-2000
It was already parsed above in general for all video codecs. Just put the number of fields into the JPEG-2000 in the specific field. As a side effect this also actually checks if enough data is available. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8929>
This commit is contained in:
parent
45443603f8
commit
137044195d
@ -15177,7 +15177,7 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
case FOURCC_mjp2:
|
case FOURCC_mjp2:
|
||||||
{
|
{
|
||||||
/* see annex I of the jpeg2000 spec */
|
/* see annex I of the jpeg2000 spec */
|
||||||
GNode *jp2h, *ihdr, *colr, *mjp2, *field, *prefix, *cmap, *cdef;
|
GNode *jp2h, *ihdr, *colr, *mjp2, *prefix, *cmap, *cdef;
|
||||||
const guint8 *data;
|
const guint8 *data;
|
||||||
const gchar *colorspace = NULL;
|
const gchar *colorspace = NULL;
|
||||||
gint ncomp = 0;
|
gint ncomp = 0;
|
||||||
@ -15332,17 +15332,15 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak, guint32 * mvhd_matrix)
|
|||||||
g_free (chan_def);
|
g_free (chan_def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* indicate possible fields in caps */
|
||||||
|
if (CUR_STREAM (stream)->interlace_mode != 1) {
|
||||||
|
gst_caps_set_simple (entry->caps, "fields", G_TYPE_INT,
|
||||||
|
CUR_STREAM (stream)->interlace_mode, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* some optional atoms */
|
/* some optional atoms */
|
||||||
field = qtdemux_tree_get_child_by_type (mjp2, FOURCC_fiel);
|
|
||||||
prefix = qtdemux_tree_get_child_by_type (mjp2, FOURCC_jp2x);
|
prefix = qtdemux_tree_get_child_by_type (mjp2, FOURCC_jp2x);
|
||||||
|
|
||||||
/* indicate possible fields in caps */
|
|
||||||
if (field) {
|
|
||||||
data = (guint8 *) field->data + 8;
|
|
||||||
if (*data != 1)
|
|
||||||
gst_caps_set_simple (entry->caps, "fields", G_TYPE_INT,
|
|
||||||
(gint) * data, NULL);
|
|
||||||
}
|
|
||||||
/* add codec_data if provided */
|
/* add codec_data if provided */
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user