Hi,
I've got a little problem with libmad. On some mp3 I have, libmad find a first frame somewhere it probably shouldn't. The problem appeared with mythtv where some files were played in mono instead of stereo and at half the speed.
I made some tests with madlld and I get some strange output like this: [...] madlld: recoverable frame level error (forbidden bitrate value) madlld: recoverable frame level error (forbidden bitrate value) madlld: recoverable frame level error (forbidden bit allocation value) madlld: recoverable frame level error (forbidden bit allocation value) madlld: recoverable frame level error (forbidden bit allocation value) madlld: 25000 kb/s audio MPEG layer I stream without CRC, single channel with no emphasis at 44100 Hz sample rate madlld: recoverable frame level error (lost synchronization) madlld: recoverable frame level error (reserved header layer value) [...] I understand that "lost sync" can occur (and it does on good files too so I guess it's ok) but I can't find 25000 kb/s in bitrate_table (frame.c) so I think the "forbidden bit allocation value" errors offsets something by less than a byte. I wrote a small test program which search for sync word and try to decode the frame header without using libmad. Using it I get the following output:
Frame at 504 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 508 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 512 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 516 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 520 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 532 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 536 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 540 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 544 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 548 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 560 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 564 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 568 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 572 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 576 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 588 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 592 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 596 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 600 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 604 - MPEG v1 Layer I No CRC Bad frame! (bitrate) Frame at 48330 - MPEG v1 Layer III No CRC Bitrate 192 Samplerate 44 Padding 1 Stereo No emphasis [...]
It was written fast so it might be wrong, but it seems correct (the last line is consistent with iTunes or mp3blaster). I haven't found how to get the current location in the buffer from libmad so I can't tell where it get this strange frame. I'll be glad to give any precision or do any tests one might want but I'm a bit lost right now. From what I can see, libmad resync on the next frame, but for mythtv it's too late since it never rebind the channels or sample rate for the current playing song.
If it's not the right list, please let me know so I can ask somewhere else. -- Hugues Lismonde < hugues.lismonde@hli.be >