&& 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;