[vlc-commits] aout: add more debug checks

Thomas Guillem git at videolan.org
Fri Oct 7 12:10:17 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Oct  6 16:26:32 2016 +0200| [8818a1b10d07accb9ac44c0f7376625ca23f87ab] | committer: Thomas Guillem

aout: add more debug checks

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8818a1b10d07accb9ac44c0f7376625ca23f87ab
---

 src/audio_output/output.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/audio_output/output.c b/src/audio_output/output.c
index 90db056..8a7f93b 100644
--- a/src/audio_output/output.c
+++ b/src/audio_output/output.c
@@ -445,6 +445,7 @@ int aout_OutputNew (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     }
 
     aout_FormatPrepare (fmt);
+    assert (fmt->i_bytes_per_frame > 0 && fmt->i_frame_length > 0);
     aout_FormatPrint (aout, "output", fmt);
     return 0;
 }
@@ -480,6 +481,12 @@ int aout_OutputTimeGet (audio_output_t *aout, mtime_t *delay)
 void aout_OutputPlay (audio_output_t *aout, block_t *block)
 {
     aout_OutputAssertLocked (aout);
+#ifndef NDEBUG
+    aout_owner_t *owner = aout_owner (aout);
+    assert (block->i_buffer / block->i_nb_samples ==
+            owner->mixer_format.i_bytes_per_frame /
+            owner->mixer_format.i_frame_length);
+#endif
     aout->play (aout, block);
 }
 



More information about the vlc-commits mailing list