FS#6216 - Update so MP3 files are only opened once

Attached to Project: Rockbox
Opened by Steve Bavin (pondlife) - Friday, 20 October 2006, 16:34 GMT
Task Type Patches
Category ID3 / meta data
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Currently MP3 files are opened twice when played - once for playback and seperately for ID3 parsing.
This small patch adds an interface so the playback file handle can be used for ID3 parsing too.
This task depends upon

Closed by  Miika Pekkarinen (miipekk)
Wednesday, 25 October 2006, 16:58 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed with the corrections.
Comment by Steve Bavin (pondlife) - Wednesday, 25 October 2006, 09:02 GMT
Here's a slightly updated version - this reverses the return from get_mp3_metadata to bring it into line with other formats (true=success, false=error).
Comment by Miika Pekkarinen (miipekk) - Wednesday, 25 October 2006, 16:36 GMT
Looks good, but the check in the new function if file open failed must be: if (fd < 0) ... not if (fd == -1). Probably it should return also false.
Comment by Steve Bavin (pondlife) - Wednesday, 25 October 2006, 16:42 GMT
OK, will update the test. mp3info() actually returns true to indicate an error, so I think that bit is correct.

You don't think that there's a potential problem with the same file seek position being used for both metadata and playback buffering? I assume not, or this would be a problem for other formats...