aout: fix check assert before play
authorThomas Guillem <thomas@gllm.fr>
Wed, 19 Oct 2016 08:06:13 +0000 (10:06 +0200)
committerThomas Guillem <thomas@gllm.fr>
Wed, 19 Oct 2016 08:06:27 +0000 (10:06 +0200)
i_buffer and i_nb_samples can be 0.

src/audio_output/output.c

index 8a7f93b..13536ec 100644 (file)
@@ -483,7 +483,8 @@ 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 ==
+    assert (owner->mixer_format.i_frame_length > 0);
+    assert (block->i_buffer == 0 || block->i_buffer / block->i_nb_samples ==
             owner->mixer_format.i_bytes_per_frame /
             owner->mixer_format.i_frame_length);
 #endif