aacparse: assertion while converting ADTS stream to RAW

aacparse resizes input buffer while converting ADTS stream to RAW,
During buffer resize buffer write permission is not checked.
This throws gst_buffer_is_writable assertion and leads to AV sync issue some times.
It is corrected by making buffer writeable using gst_buffer_make_writable

https://bugzilla.gnome.org/show_bug.cgi?id=774129
This commit is contained in:
Vinod Kesti 2016-11-15 16:52:39 +05:30 committed by Sebastian Dröge
parent e5b3d9257d
commit f1726c7088

View file

@ -1452,11 +1452,13 @@ gst_aac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
&& aacparse->output_header_type == DSPAAC_HEADER_NONE) {
guint header_size;
GstMapInfo map;
gst_buffer_map (frame->buffer, &map, GST_MAP_READ);
frame->out_buffer = gst_buffer_make_writable (frame->buffer);
frame->buffer = NULL;
gst_buffer_map (frame->out_buffer, &map, GST_MAP_READ);
header_size = (map.data[1] & 1) ? 7 : 9; /* optional CRC */
gst_buffer_unmap (frame->buffer, &map);
gst_buffer_resize (frame->buffer, header_size,
gst_buffer_get_size (frame->buffer) - header_size);
gst_buffer_unmap (frame->out_buffer, &map);
gst_buffer_resize (frame->out_buffer, header_size,
gst_buffer_get_size (frame->out_buffer) - header_size);
}
return GST_FLOW_OK;