Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

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

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

Details

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.
(application/octet-stream)    fix_mp3_double_open.patch (2.5 KiB)
 apps/metadata.c       |    2 +-
 firmware/id3.c        |   25 +++++++++++++++++--------
 firmware/export/id3.h |    1 +
 3 files changed, 19 insertions(+), 9 deletions(-)

This task depends upon

Closed by  Miika Pekkarinen (miipekk)
Wednesday, 25 October 2006, 18:58 GMT+2
Reason for closing:  Accepted
Additional comments about closing:  Committed with the corrections.
Comment by Steve Bavin (pondlife) - Wednesday, 25 October 2006, 11:02 GMT+2
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).
(application/octet-stream)    fix_mp3_double_open_v2.patch (4.8 KiB)
 apps/metadata.c       |   34 ++++------------------------------
 firmware/id3.c        |   30 ++++++++++++++++++++----------
 firmware/export/id3.h |    1 +
 3 files changed, 25 insertions(+), 40 deletions(-)

Comment by Miika Pekkarinen (miipekk) - Wednesday, 25 October 2006, 18:36 GMT+2
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, 18:42 GMT+2
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...

Loading...