Re: [mpg123-devel] Help please...
Brought to you by:
sobukus
From: Clive C. <cl...@wi...> - 2012-01-30 10:28:42
|
> I cooked up a piece of example code (in form of a regression test) that should show your issue, from the description. Can you check the attached program on your setup? Build/link with libmpg123, just give a mp3 file as sole paramater. > > I don't see any trouble with that program. What's the difference to yours? Okay now I can see what I am doing wrong. The mp3 file I am reading is not a file, it resides in a buffer in memory. So I am opening it with ... mpg123_init(); hMp3 = mpg123_new(NULL, &ret); len = mp3BufSize; mpg123_open_feed(hMp3); ret = mpg123_decode(hMp3, (uchar*)mp3Buffer, len, out, 0, &tsize); I grab the format and then switch to decoding using mpg123_decode_frame(hMp3, &fNum, &bbuff, &bytes); because I just want individual frames. So it is the open feed and the decode frame that should not be used together the way I am doing so. mpg123 assumes it is reading a dynamic stream rather than a static buffer and I guess it is that what is causing all the trouble. Can you suggest/help/prod me on how I should open (mpg123_open()) when the whole mp3 file is sitting in a buffer in memory as opposed to being an external file? Clive -- Infinity: A concept for those who cannot comprehend the big picture. () Arch Linux - For movers and shakers. () |