avi: use new riff api to extract nikon metadata

Fixes #636143
This commit is contained in:
Stefan Sauer 2014-01-04 21:34:38 +01:00
parent 70d3ff2f79
commit f48bb20b4f

View file

@ -3795,6 +3795,22 @@ gst_avi_demux_stream_header_pull (GstAviDemux * avi)
gst_buffer_unref (sub);
sub = NULL;
break;
case GST_RIFF_LIST_ncdt:
gst_buffer_unmap (sub, &map);
gst_buffer_resize (sub, 4, -1);
gst_riff_parse_ncdt (element, sub, &tags);
if (tags) {
if (avi->globaltags) {
gst_tag_list_insert (avi->globaltags, tags,
GST_TAG_MERGE_REPLACE);
} else {
avi->globaltags = tags;
}
}
tags = NULL;
gst_buffer_unref (sub);
sub = NULL;
break;
default:
GST_WARNING_OBJECT (avi,
"Unknown list %" GST_FOURCC_FORMAT " in AVI header",
@ -3912,6 +3928,40 @@ gst_avi_demux_stream_header_pull (GstAviDemux * avi)
gst_buffer_unref (buf);
/* gst_riff_read_chunk() has already advanced avi->offset */
break;
case GST_RIFF_LIST_ncdt:
res =
gst_riff_read_chunk (element, avi->sinkpad, &avi->offset, &tag,
&buf);
if (res != GST_FLOW_OK) {
GST_DEBUG_OBJECT (avi, "couldn't read ncdt chunk");
goto pull_range_failed;
}
GST_DEBUG ("got size %" G_GSIZE_FORMAT, gst_buffer_get_size (buf));
if (size < 4) {
GST_DEBUG ("skipping ncdt LIST prefix");
avi->offset += (4 - GST_ROUND_UP_2 (size));
gst_buffer_unref (buf);
continue;
}
sub = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, 4, -1);
gst_riff_parse_ncdt (element, sub, &tags);
if (tags) {
if (avi->globaltags) {
gst_tag_list_insert (avi->globaltags, tags,
GST_TAG_MERGE_REPLACE);
} else {
avi->globaltags = tags;
}
}
tags = NULL;
if (sub) {
gst_buffer_unref (sub);
sub = NULL;
}
gst_buffer_unref (buf);
/* gst_riff_read_chunk() has already advanced avi->offset */
break;
default:
GST_WARNING_OBJECT (avi,
"Skipping unknown list tag %" GST_FOURCC_FORMAT,