[TwoLAME-discuss] multi-threading
MPEG-Audio Layer 2 (MP2) encoder
Status: Beta
Brought to you by:
nhumfrey
From: dave a. <da...@re...> - 2012-02-28 05:01:39
|
hi folks. the twolame encoder is really, really slick. but i have a problem. we got new computers with 8 cores, so i have split an encoding pgm up into threads to run in parallel. but i'm getting some random errors - mp2 frames not aligned properly. (win7, i built the dll using your vc++ project file and visual c++ 2010) what really makes the problem apparent is i'm encoding some files at 44100 and others at 48000 at the same time. frame sizes 626 and 576 respectively (192kbits, mono). my pgm to check the mp2 frames tells me how many bytes it has to skip to sync up to the next good frame, and when i'm encoding 44100 (frame size 626) it will report a bad frame, and 576 bytes to sync up to the next frame. so somehow 576 bytes have been inserted where they don't belong. (and they do not have a valid frame header.) when encoding 48000 (frame size 576) i'll see a bad frame, then 50 bytes to sync up (626-675=50). so 626 bytes have been inserted. (without a valid frame header.) the resulting bad mp2 files for 48000 are 50 bytes bigger than a "correct" file, and for the 44100 files, the bad files are 50 bytes smaller, i presume from putting a i know multi-threading is quite the can of worms, but it may become more common as they add cores to cpus rather than speed -- until the next speed breakthrough. just wondering what i might check on my end to make sure i'm doing this right. it all works fine when i do one file at a time, or when i do all the 48000 conversions, then the 44100. that's what i'll do until i figure something else out. ain't threads wunnuful ?? thanks. dave allen colorado |