diff options
| author | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-04-15 19:20:57 +0000 |
|---|---|---|
| committer | Nicolas Pennequin <nicolas.pennequin@free.fr> | 2008-04-15 19:20:57 +0000 |
| commit | b36d3c0be228fbf7ad1b193d11d8a3365a045a43 (patch) | |
| tree | e3c4686fbc89da7bf659431270b00e14dcbde5f5 | |
| parent | 7acc5538bd6964a15062a427dbc311c9c2344753 (diff) | |
| download | rockbox-b36d3c0be228fbf7ad1b193d11d8a3365a045a43.zip rockbox-b36d3c0be228fbf7ad1b193d11d8a3365a045a43.tar.gz rockbox-b36d3c0be228fbf7ad1b193d11d8a3365a045a43.tar.bz2 rockbox-b36d3c0be228fbf7ad1b193d11d8a3365a045a43.tar.xz | |
Some bugfixes after r17109:
* Fix FS#8893 by plugging a file descriptor leak in audio_load_track.
* Fix a possible null pointer dereference by not allowing audio_current_track to return NULL.
* Make audio_current_track return prevtrack_id3 only during an automatic track skip. Fixes the wrong metadata being displayed for a short time after a backwards skip.
-Cette ligne, et les suivantes ci-dessous, seront ignorées--
M apps/playback.c
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17126 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playback.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/playback.c b/apps/playback.c index bce4b6b..38da93b 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -552,7 +552,7 @@ struct mp3entry* audio_current_track(void) /* The usual case */ return &curtrack_id3; } - else if (offset == -1 && *prevtrack_id3.path) + else if (automatic_skip && offset == -1 && *prevtrack_id3.path) { /* We're in a track transition. The codec has moved on to the nex track, but the audio being played is still the same (now previous) track. @@ -563,7 +563,8 @@ struct mp3entry* audio_current_track(void) else if (tracks[cur_idx].id3_hid >= 0) { /* Get the ID3 metadata from the main buffer */ - return bufgetid3(tracks[cur_idx].id3_hid); + struct mp3entry *ret = bufgetid3(tracks[cur_idx].id3_hid); + if (ret) return ret; } /* We didn't find the ID3 metadata, so we fill temp_id3 with the little info @@ -1648,8 +1649,6 @@ static bool audio_load_track(size_t offset, bool start_play) return false; } - close(fd); - if (track_widx == track_ridx) { buf_request_buffer_handle(tracks[track_widx].id3_hid); @@ -1664,6 +1663,7 @@ static bool audio_load_track(size_t offset, bool start_play) } } + close(fd); return true; } |