forked from len0rd/rockbox
When ffw/rew, correctly handle case where mpeg_file < 0 (eg. when playing last song of playlist with repeat off)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2505 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f8e10b316d
commit
c53859388f
1 changed files with 10 additions and 2 deletions
|
@ -1047,7 +1047,11 @@ static void mpeg_thread(void)
|
|||
}
|
||||
|
||||
newpos = newpos & ~1;
|
||||
curpos = lseek(mpeg_file, 0, SEEK_CUR);
|
||||
|
||||
if (mpeg_file >= 0)
|
||||
curpos = lseek(mpeg_file, 0, SEEK_CUR);
|
||||
else
|
||||
curpos = id3->filesize;
|
||||
|
||||
if (num_tracks_in_memory() > 1)
|
||||
{
|
||||
|
@ -1083,7 +1087,7 @@ static void mpeg_thread(void)
|
|||
unplayed_space_left = get_unplayed_space();
|
||||
unswapped_space_left = get_unswapped_space();
|
||||
|
||||
if (unplayed_space_left < MPEG_LOW_WATER)
|
||||
if (mpeg_file>=0 && unplayed_space_left < MPEG_LOW_WATER)
|
||||
{
|
||||
/* We need to load more data before starting */
|
||||
filling = true;
|
||||
|
@ -1112,7 +1116,11 @@ static void mpeg_thread(void)
|
|||
/* We have to reload the current track */
|
||||
close(mpeg_file);
|
||||
remove_all_non_current_tags();
|
||||
mpeg_file = -1;
|
||||
}
|
||||
|
||||
if (mpeg_file < 0)
|
||||
{
|
||||
mpeg_file = open(id3->path, O_RDONLY);
|
||||
if (mpeg_file < 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue