0012-Fix-ogg123-speex-playback-Initialize-channel-matrix.patch 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From: =?utf-8?q?Martin_Stegh=C3=B6fer?= <martin@steghoefer.eu>
  2. Date: Wed, 10 Dec 2014 22:28:25 +0100
  3. Subject: Fix ogg123 speex playback: Initialize channel matrix
  4. The speex decoder didn't initialize the channel matrix,
  5. which caused libao to print the cryptic error message
  6. '" in channel matrix ""' and occasionally (depending on
  7. the output device) to abort audio output.
  8. Bug-Debian: https://bugs.debian.org/772766
  9. ---
  10. ogg123/speex_format.c | 14 +++++++++++++-
  11. 1 file changed, 13 insertions(+), 1 deletion(-)
  12. diff --git a/ogg123/speex_format.c b/ogg123/speex_format.c
  13. index c5a453d..c42e429 100644
  14. --- a/ogg123/speex_format.c
  15. +++ b/ogg123/speex_format.c
  16. @@ -560,7 +560,19 @@ int read_speex_header (decoder_t *decoder)
  17. if (!priv->frames_per_packet)
  18. priv->frames_per_packet=1;
  19. -
  20. +
  21. + switch(decoder->actual_fmt.channels) {
  22. + case 1:
  23. + decoder->actual_fmt.matrix="M";
  24. + break;
  25. + case 2:
  26. + decoder->actual_fmt.matrix="L,R";
  27. + break;
  28. + default:
  29. + decoder->actual_fmt.matrix=NULL;
  30. + break;
  31. + }
  32. +
  33. priv->output = calloc(priv->frame_size *
  34. decoder->actual_fmt.channels *