aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter/RouteFilterPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-07 18:14:57 +0200
committerMax Kellermann <max@duempel.org>2013-08-07 18:23:34 +0200
commitd86ee93801aed64e9eaf16849b7b008e0089b0c9 (patch)
treeb56f7e8464afa9de3196dddb8343e49c25cd8552 /src/filter/RouteFilterPlugin.cxx
parent87b732846388d3c4a2d755863df4328a6c08041e (diff)
downloadmpd-d86ee93801aed64e9eaf16849b7b008e0089b0c9.tar.gz
mpd-d86ee93801aed64e9eaf16849b7b008e0089b0c9.tar.xz
mpd-d86ee93801aed64e9eaf16849b7b008e0089b0c9.zip
filter/Route: don't access PcmBuffer attributes directly
Return the pointer given by PcmBuffer::Get() instead of reaching into the PcmBuffer object.
Diffstat (limited to 'src/filter/RouteFilterPlugin.cxx')
-rw-r--r--src/filter/RouteFilterPlugin.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/filter/RouteFilterPlugin.cxx b/src/filter/RouteFilterPlugin.cxx
index ceb944822..2c0d60cbe 100644
--- a/src/filter/RouteFilterPlugin.cxx
+++ b/src/filter/RouteFilterPlugin.cxx
@@ -275,12 +275,12 @@ RouteFilter::FilterPCM(const void *src, size_t src_size,
// A moving pointer that always refers to channel 0 in the input, at the currently handled frame
const uint8_t *base_source = (const uint8_t *)src;
- // A moving pointer that always refers to the currently filled channel of the currently handled frame, in the output
- uint8_t *chan_destination;
-
// Grow our reusable buffer, if needed, and set the moving pointer
*dest_size_r = number_of_frames * output_frame_size;
- chan_destination = (uint8_t *)output_buffer.Get(*dest_size_r);
+ void *const result = output_buffer.Get(*dest_size_r);
+
+ // A moving pointer that always refers to the currently filled channel of the currently handled frame, in the output
+ uint8_t *chan_destination = (uint8_t *)result;
// Perform our copy operations, with N input channels and M output channels
for (unsigned int s=0; s<number_of_frames; ++s) {
@@ -313,7 +313,7 @@ RouteFilter::FilterPCM(const void *src, size_t src_size,
}
// Here it is, ladies and gentlemen! Rerouted data!
- return (void *) output_buffer.buffer;
+ return result;
}
const struct filter_plugin route_filter_plugin = {