Gabriel Bouvigne bouvigne@mp3-tech.org wrote:
Do you mean that right now, mad only try decoding at the seek offset without trying to get teh previous data necessary for decoding (like previous frames when main_data_begin>0)?
Right now, madplay only supports seeking via the -s option, which works by reading headers (only) until the given time is reached. It does not fully decode any frames prior to this point, nor does it preload the main_data buffer with anything from the skipped frames.
The plug-in for Winamp works slightly differently; it supports full seeking to any arbitrary location during playback. Once the seek location is found, a few frames are read in order to sync with the new stream position, pre-load the main_data buffer, and prime the IMDCT overlap outputs. Then, subband synthesis is performed once on the latest frame to prime the filterbank; the PCM result from this is discarded. Normal decoding and playback then resumes.
More precise positioning would indeed need more effort to properly decode frames preceding the seek point.
Cheers, -rob