audioringbuffer: Reset reorder flag before check
authorJochen Henneberg <jh@henneberg-systemdesign.com>
Mon, 26 Aug 2019 13:03:48 +0000 (15:03 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 17 Nov 2019 15:41:55 +0000 (15:41 +0000)
This function might be revisited with different channel position mapping
while audio source goes into play so the reorder flag needs to be reset
before the checks happen.

gst-libs/gst/audio/gstaudioringbuffer.c

index cd5197e..f4d5c97 100644 (file)
@@ -2034,6 +2034,7 @@ gst_audio_ring_buffer_set_channel_positions (GstAudioRingBuffer * buf,
   channels = buf->spec.info.channels;
   to = buf->spec.info.position;
 
+  buf->need_reorder = FALSE;
   if (memcmp (position, to, channels * sizeof (to[0])) == 0)
     return;
 
@@ -2042,7 +2043,6 @@ gst_audio_ring_buffer_set_channel_positions (GstAudioRingBuffer * buf,
     return;
   }
 
-  buf->need_reorder = FALSE;
   if (!gst_audio_get_channel_reorder_map (channels, position, to,
           buf->channel_reorder_map))
     g_return_if_reached ();