1
0
Fork 0
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:
Hardeep Sidhu 2002-10-04 16:39:02 +00:00
parent f8e10b316d
commit c53859388f

View file

@ -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)
{