Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Main_data area (Read 1867 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Main_data area

Hello all,

I'm trying to write a simple mp3 decoder. My program opens a file, find a synchword and read the header and size information for the frame. My question is about the main data area. If I understand correctly, it contains the main data of the frame and can also contain the main data of successive frames. In my code, I use a circular buffer to store the main data area. I'd like to know how to set a pointer to the beginning of the main data of the frame. Is the following formula correct for frame number n ?

begin(n) = end(n - 1) - main_data_begin(n) + 1

where end(n-1) is the last byte of main data for the previous frame

I've already looked at several engines source code but I couldn't understand how the main data is organized. Thanks for any explanations.