Commit f1726c70 authored by Vinod Kesti's avatar Vinod Kesti Committed by Sebastian Dröge

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
parent e5b3d925
......@@ -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;
......
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