Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 436528

Summary: media-libs/speex: Resampler stops in the middle of run with multiple channels
Product: Gentoo Linux Reporter: Franz Schrober <franzschrober>
Component: [OLD] LibraryAssignee: Gentoo Sound Team <sound>
Status: UNCONFIRMED ---    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: speex_resampler_missing_outputsamples.c.xz
resample_save_in_len_for_multiple_channels.patch

Description Franz Schrober 2012-09-28 17:33:02 UTC
Hi,

I noticed a quite strange behavior of speex when I resample a large input 
buffer (so underbuffering is not a problem). It stops during the call even 
when neither the number of requested out_len nor the number of provided input 
samples was reached.

http://www.speex.org/docs/manual/speex-manual/node7.html says something 
completely different:

"Unless an error occurs, either all input samples will be read or all output 
samples will be written to (or both)."

I've attached a test program that should show the problem. The input buffer is 
usually a lot larger, but I reduced it to keep the source file small. I get 
following output form the test program:

"Resampling stopped during processing. 2 samples missing in output and 100 
samples from input weren't used".

The example can be compiled using:

$ unxz speex_resampler_missing_outputsamples.c.xz
$ gcc speex_resampler_missing_outputsamples.c \
`pkg-config --cflags --libs speexdsp` \
-o speex_resampler_missing_outputsamples

A patch to fix this problem is attached.

Reproducible: Always
Comment 1 Franz Schrober 2012-09-28 17:33:36 UTC
Created attachment 325236 [details]
speex_resampler_missing_outputsamples.c.xz
Comment 2 Franz Schrober 2012-09-28 17:34:09 UTC
Created attachment 325238 [details, diff]
resample_save_in_len_for_multiple_channels.patch