diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c index 34ba80a7c2..d9dc424e54 100644 --- a/gst/audioparsers/gstaacparse.c +++ b/gst/audioparsers/gstaacparse.c @@ -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;