[Bug 785471] [API]: gst_audio_channel_mixer_new_with_matrix
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Fri Sep 22 08:33:27 UTC 2017
https://bugzilla.gnome.org/show_bug.cgi?id=785471
Sebastian Dröge (slomo) <slomo at coaxion.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #360187|none |needs-work
status| |
--- Comment #31 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Review of attachment 360187:
--> (https://bugzilla.gnome.org/review?bug=785471&attachment=360187)
::: gst-libs/gst/audio/audio-channel-mixer.c
@@ +124,3 @@
+ * an identity matrix */
+ if (flags & GST_AUDIO_CHANNEL_MIXER_FLAGS_UNPOSITIONED_IN) {
+ matrix[ci][co] = ci == co ? 1.0 : 0.0;
Why is this case needed now? Maybe could be in a separate commit :)
@@ +446,3 @@
RATIO_FRONT_SIDE);
} else if (!in_has_front && in_has_center && in_has_side && out_has_front) {
+ gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_f,
This refactoring could also go into a separate commit, it would make it easier
to read the actual changes and help "git bisect"
@@ +840,3 @@
+ mix->matrix[i] = g_new (gfloat, out_channels);
+ for (j = 0; j < out_channels; j++) {
+ mix->matrix[i][j] = i == j ? 1.0 : 0.0;
Is this correct? Previously we allocated the matrix with all-zeroes. It's not
really identity that is needed here but we need to find out what is needed
based on the two channel position arrays
@@ +907,3 @@
+ *
+ * Returns: a new #GstAudioChannelMixer object. Free with
gst_audio_channel_mixer_free()
+ * after usage.
Also returns NULL if the matrix is invalid or incompatible with the channel
numbers
@@ +965,3 @@
+ for (j = 0; j < mix->out_channels; j++) {
+ if ((i == j && mix->matrix[i][j] != 1.0f) ||
+ (i != j && mix->matrix[i][j] != 0.0f)) {
Needs a comment why comparing floating point numbers here is not a problem
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list