This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#10614 - Deleting files in USB mode can confuse resume playback/bookmark functionality.
Attached to Project:
Rockbox
Opened by Alex Bennee (ajb) - Wednesday, 23 September 2009, 11:13 GMT+2
Opened by Alex Bennee (ajb) - Wednesday, 23 September 2009, 11:13 GMT+2
|
DetailsSteps to reproduce:
1. Start listening to a series of podcasts, say 1-5 2. After listening to >1 plug player into computer during playback of subsequent podcast 3. Delete the podcasts you have already listened to (not what your currently listening to) 4. Eject/Unplug player from computer 5. Attempt to resume playback This fails for both resume and Recent Bookmarks functionality. I assume this is somehow tied in with playlist support as files from the playlist have been deleted. Where does Recent Bookmarks keep it's information? Should the bookmark also keep the individual file referenced so it can resume in this case? Tested on R21184M-090604 Will test on latest version once my main machine is back on internet. |
This task depends upon
I investigated the code and here is the problem:
The resume info somehow gets loaded into global_status and the resume happens in apps/root_menu.c in the wpsscrn function. There is even a DEBUGF statement there. As you can tell it only gets the resume_index and resume_offset. What it really needs to do is to check the filename against the one stored in the bookmark or wherever. If the index is not the same file then it will need to get the proper index and then play the proper file.
This bug has been irritating me for months and I have been hoping to find a solution for it but I have no idea how global_status gets loaded. Does someone know? I've looked all over in the code but I can't see how the global_status struct is getting loaded.
Thanks,
Kory
"Resume Playback" uses the playlist control file to get the filename, but in the case of directory playback, that only contains the name of the folder. As the resume index refers to an entry in that folder, it can pick the wrong file. This case isn't aware of bookmarks, and doesn't really know where to look for them (other than the recent bookmarks list, which might not contain the file of interest anyway).
Here is what you need to do:
In the apps/bookmark.c file move this line to the apps/bookmark.h file after the #include line
#define RECENT_BOOKMARK_FILE ROCKBOX_DIR "/most-recent.bmark"
So what you are doing is removing this line from the .c file and moving it into the .h file so that root_menu.c will be able to access it as well.
Open the root_menu.c file and find the wpsscrn() function.
static int wpsscrn(void* param)
Find this block of code in that function:
if (playlist_resume() != -1)
{
playlist_start(global_status.resume_index,
global_status.resume_offset);
ret_val = gui_wps_show();
}
Replace it with the following:
if (playlist_resume() != -1)
{
bookmark_load(RECENT_BOOKMARK_FILE, true);
ret_val = gui_wps_show();
}
Then just do a make and then a make zip or a make fullzip and copy that onto your device. This works for me on a Sansa e200 series player.
If you do use recent bookmarks, and always save bookmarks (for the relevant files), then it is simply a matter going to the main menu, select "Recent Bookmarks" and then the first entry. Not quite as easy to use as "Resume Playback", but for me it only requires two button presses (as I have the main menu as the start screen).
Resume playback uses a different function to resume playback and relies on the index being valid. Perhaps the resume point could be stored much as a bookmark is stored, with filename and directory, vs. just the playlist position. Or even ensuring that the dynamic playlist somehow stays in sync with file additions and deletions. That's a more extensive rework. It may not even be worth the effort since bookmarks behave themselves now.