Hi,
I have found that a number of AVI files which are encoded with MP3
audio tracks do not detect the audio track correctly.
The problem is in AviReadStreamA::StartStreaming in
lib/aviread/AviReadStreamA.cpp
The problem is that in the loop that searches for a valid MP3 frame
header, sometimes a string of bytes that looks like a header is found
and used as a header, when it should not be.
while (m_pAudioInfo->frame_size == 0 || m_pAudioInfo->layer != 3)
...
m_pAudioInfo->Init(b + j++);
if (m_pAudioInfo->frame_size)
break;
}
Here, m_pAudioInfo->Init(b + j++); finds what looks like a valid MP3
frame header, (and in fact, the bytes do make a valid header), but
the bytes found are not THE header. Now the audio subsystem is
initialized with incorrect values.
If I hard code m_pAudioInfo->Init with the values that I know the
MP3 stream uses, and to only return valid when it finds those numbers,
then the audio plays correctly.
It looks like a way to fix this problem would be to make
AviReadStreamA::StartStreaming do more than just search for 4 bytes
that look like an MP3 header. Unfortunately, I do not know how
to do that.
I hope this helps.
-Paul
_______________________________________________
Avifile mailing list
[EMAIL PROTECTED]
http://prak.org/mailman/listinfo/avifile