Looking at Winamp codebase

Breaking news from the Slowpoke News Channel™: a source code base for Winamp has been released (just last month). So it’s a good occasion to talk about it and what interesting (for me) things can be found in the third-party libraries.

I think I used the software a bit back in the day when MP3 was still rage (and there were CDs sold proudly featuring MP3 at 256kbps) and I still was using Windows (so around 1998-1999). I even briefly tried K-Jofol player (does anybody remember that?) but I didn’t see much point in that. About at that time I finally switched to Linux as my main OS and started using XMMS and XMMS2 (I actually met one of its developers at FOSDEM once—and saw a llama or two when I visited a zoo but that’s beside the point). Also there was a plugin for XMMS2 that added VQF support (again, nowadays hardly anybody remembers the format but it was an interesting alternative; luckily Vitor Sessak reverse engineered it eventually). But with the time I switched to MPlayer for playing music and nowadays I use my own player with my own decoders for the formats I care about (including MP3).

But I wanted to talk about the code, not about how little I care about the program.

First fun thing is that the source code release looks like somebody was lazy and thinking something similar to “let’s just drop what we have around and tell not to do much with it—it’ll create some hype for us”.

Second fun thing is that it fails to live up to the name. As it should be obvious, the name comes from AMP—one of the earliest practical MP3 decoders (the alternatives I can remember from those times were dist10 or the rather slow Fraunh*fer decoder). And of course WinAMP uses mpg123 for decoding instead (I vaguely remember that they switched the decoding engine to the disappointment of some users but I had no reason to care even back then).

But the main thing is that they’ve managed to do what Baidu failed to do—they’ve made VP5 decoder and VP6 codec open-source. Of course it may be removed later but for now the repository contains the library with the traditional Truemotion structure that has VP5 decoder as well as VP6 decoder and VP6 encoder. So those who wanted an open-source VP6 encoder—grab it while it’s still there (and I still have my own implementations for either of those things).

Out of curiosity I looked at the encoder and I was not impressed. It has more features (like two-pass encoding) and more refined rate control but it does not look that much better. I wonder what Peter Ross could say about it, being a developer of a popular and well-respected encoder for a codec with rather similar structure.

Overall, the code base looks like a mess with no clear structure, with most libraries shoved into one directory without any further attempt to separate them by purpose. But it does not matter as it was not intended for the large collaborative efforts and two or three programmers could live with it.

Still, let’s see if something good comes from this source release.

Update from October 17th: looks like the original owners had enough fun and removed the repository. So those who’re still willing to study the code need to locate one of countless copies of it first.

10 Responses to “Looking at Winamp codebase”

  1. Peter says:

    Nice find.

    They already nuked the Dolby AAC+ decoder from the repo. Well they tried to. https://github.com/WinampDesktop/winamp/commit/0003d3d

    There are still some interlacing quirks in NihAV decoders for vp6 (IIRC) and vp7 (100% certain). So this dump might be useful if anyone can be bothered.

  2. Kostya says:

    From what I see they do interlacing in VP6 the same was as I understood it from the binary specification – set different base scan for the frame and merely double the stride for the block pointers.

    VP7 is a different beast but I get no complaints from the users about interlaced content support 😉

  3. Paul says:

    *AMP is waste of electronic resources.

    If there were anything useful there it would stay closed source.

  4. Kostya says:

    That’s a fair point. But you might’ve heard a saying “i brojene ovce vuk jede, kamo li nebrojene” “that’s for the birds”. Even if you see not so much value in releasing something, it does not mean others can’t find anything useful there.

  5. Paul says:

    I have very warm feelings about those wolves finding any value in that code-base today.

    World moved on, almost every single component that people of the past found useful and that is in that dump is in better shape on some other open source repository today.

    I can just label it as dump nostalgia grifter for once popular piece of closed source electronic junk.

    But, you are indeed correct, almost any junk (including binary combinations stored somewhere) is useful and or valued to some degree, if you can make use of it.

  6. Kostya says:

    I agree with you. As said in the post, I’ve not found anything useful for me (and it’s not nostalgic to me either) but there were some funny bits. And while the code is not organised well, at least it’s self-contained (i.e. does not download a thousand npm.js dependencies—or crates, Ba modules, whatever).

  7. Peter says:

    Hey Kostya. `git clone git://git.nihav.org/nihav.git` is currently failing with error.

    $ GIT_TRACE_PACKET=true git ls-remote –heads git://git.nihav.org/nihav.git
    15:47:10.132181 pkt-line.c:86 packet: ls-remote> git-upload-pack /nihav.git\0host=git.nihav.org\0\0version=2\0
    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights
    and the repository exists.

  8. Kostya says:

    Strange, web interface seems to work fine though. I’ll try to resolve it.

  9. compn says:

    almost all those vp5, vp6 and flv and nsv samples , when it first came along, were from people saving streams from winamptv. just checked the mplayer mailing list, that was 20 years ago. 2003 this justin guy just decided to create youtube/twitch by himself. and it worked! pretty flawlessly. live streaming years before youtube or twitch. justin frankel. the llama man himself. he sold winamp to AOL.

    it was the best mp3 player on windows, and then he was bored and made an entire streaming internet platform out of it. before anyone else. he made a p2p app, “waste” . it was pretty neat.

    multimikey wrote about it in 2012 https://multimedia.cx/eggs/winamp-and-the-march-of-gui/

  10. Kostya says:

    Didn’t we have RealBuffering for a streaming back then?

    In either case that’s a respectable career reminding me somewhat of Ludvig Strigeus—I know his for ScummVM and OpenTTD but apparently he got employed at a certain company for a little side project of his called uTorrent…

Leave a Reply