<div>As the subject line says, I'm trying to decode, filter and resample audio. The resampled s16le output would then be used later on.<br></div><div><br></div><div>My problem is: the output I get contains the full song, correctly resampled, but it doesn't stop there and keeps outputting about a minute or so of extra frames. Those extra frames, when played back, sound like a sped up version of the song played in reverse.<br></div><div><br></div><div>Attached is a file with my code, and there will be a direct link to download an audio file for convenience, but this happened with any file I tried no matter the format: <a href="http://freepd.com/Electronic/Fall%20Falling.mp3">http://freepd.com/Electronic/Fall%20Falling.mp3</a><br></div><div><br></div><div>Compile the file with "gcc main.c -lavformat -lavcodec -lavutil -lavfilter -lswresample -o decoder" and run it like so "./decoder input-file.mp3 > output.bin", as it'll output the PCM frames it decodes to stdout.<br></div><div><br></div><div>This code is written with version 2.8.6 in mind, because that is what's available  where I have to host this, but I've tried it on my machine with git version N-80780-gd693392 and I get the same result.<br></div><div><br></div><div>I've tried everything I could think of, but I'm not sure what I did wrong. Thanks in advance for any help!<br></div><div><br></div>