webrtc: Unmap all non-binary buffers received via the datachannel

Previously they were only unmapped in case of binary data, causing all
of them to be leaked.
This commit is contained in:
Sebastian Dröge 2020-01-07 20:17:12 +02:00 committed by Sebastian Dröge
parent db06f8e9da
commit 04c5a550ad

View file

@ -616,6 +616,7 @@ _data_channel_have_sample (GstWebRTCDataChannel * channel, GstSample * sample,
ret = GST_FLOW_ERROR;
} else {
ret = _parse_control_packet (channel, info.data, info.size, error);
gst_buffer_unmap (buffer, &info);
}
break;
}
@ -631,6 +632,7 @@ _data_channel_have_sample (GstWebRTCDataChannel * channel, GstSample * sample,
gchar *str = g_strndup ((gchar *) info.data, info.size);
_channel_enqueue_task (channel, (ChannelTask) _emit_have_string, str,
g_free);
gst_buffer_unmap (buffer, &info);
}
break;
}