mad: Correctly unmap the buffer with the original data pointer

This commit is contained in:
Sebastian Dröge 2012-01-09 15:24:53 +01:00
parent a120944340
commit 9c646f59ac

View file

@ -411,7 +411,7 @@ gst_mad_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
GstFlowReturn ret = GST_FLOW_EOS; GstFlowReturn ret = GST_FLOW_EOS;
GstBuffer *outbuffer; GstBuffer *outbuffer;
guint nsamples; guint nsamples;
gint32 *outdata; gint32 *data, *outdata;
mad_fixed_t const *left_ch, *right_ch; mad_fixed_t const *left_ch, *right_ch;
mad = GST_MAD (dec); mad = GST_MAD (dec);
@ -435,7 +435,7 @@ gst_mad_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
outbuffer = gst_buffer_new_and_alloc (nsamples * mad->channels * 4); outbuffer = gst_buffer_new_and_alloc (nsamples * mad->channels * 4);
outdata = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_WRITE); data = outdata = gst_buffer_map (outbuffer, NULL, NULL, GST_MAP_WRITE);
/* output sample(s) in 16-bit signed native-endian PCM */ /* output sample(s) in 16-bit signed native-endian PCM */
if (mad->channels == 1) { if (mad->channels == 1) {
@ -453,7 +453,7 @@ gst_mad_handle_frame (GstAudioDecoder * dec, GstBuffer * buffer)
} }
} }
gst_buffer_unmap (outbuffer, outdata, -1); gst_buffer_unmap (outbuffer, data, -1);
ret = gst_audio_decoder_finish_frame (dec, outbuffer, 1); ret = gst_audio_decoder_finish_frame (dec, outbuffer, 1);