A question for mmap()

[email protected]
Newsgroups gmane.comp.audio.mad.devel
Message-ID <A7ADC37544D6284E9C239F50D1B6AB644CE94A@mail3>
 
Hi,
 
I have a question about mmap(), hope someone can clarify for me.
As I know, mmap() maps the whole file into memory, so OS can access the
source file directly from memory.
However there should be a restriction to memory size on the embedded system.
 
In my test, I compile madplay with mmap supported, and then play a mp3 file
of 43MB, and it plays well.
But my question is I only get 32MB SDRAM on my development board.
It seems that the memory size is not large enough to store all the data.
How does mmap() work?
 
Besides, I want to implement the fast forward/rewind function.
But it is a little slow to rewind, because it needs to search the location
from the first frame, if mmap() isn't enabled.
(Maybe there are other better methods, but I don't know...)
If mmap() works, then it should be faster than without mmap(), shouldn't it?
 
Sorry for any unclear expression.
Thanks for help.
 
Regards,
Hank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.