[vlc-devel] [PATCH v2 2/7] aout: add aout_FormatEquals

Thomas Guillem thomas at gllm.fr
Wed Mar 20 18:09:09 CET 2019


---
 src/audio_output/dec.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 0c68472747..75ea4e6621 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -50,6 +50,21 @@ static void aout_Drain(audio_output_t *aout)
     }
 }
 
+static bool aout_FormatEquals(const audio_sample_format_t *f1,
+                              const audio_sample_format_t *f2)
+{
+    return f1->i_format == f2->i_format
+        && f1->i_rate == f2->i_rate
+        && f1->i_physical_channels == f2->i_physical_channels
+        && f1->i_chan_mode == f2->i_chan_mode
+        && f1->channel_type == f2->channel_type
+        && f1->i_bytes_per_frame == f2->i_bytes_per_frame
+        && f1->i_frame_length == f2->i_frame_length
+        && f1->i_bitspersample == f2->i_bitspersample
+        && f1->i_blockalign == f2->i_blockalign
+        && f1->i_channels == f2->i_channels;
+}
+
 /**
  * Creates an audio output
  */
-- 
2.20.1



More information about the vlc-devel mailing list