mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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:
parent
e5b3d9257d
commit
f1726c7088
1 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue