How do you ensure for which "movie on the DVD" the resume point is required for???
That is done based on dvd title. The file is made into /home/root and named based on dvd tittle or if lack on dvd tiitle st.mimetime.
But Thta's whay I wrote such a hugh comment in my patch about certain code by sevicedvd.cpp
void eServiceDVD::saveCuesheet()
{
eDebug("[eServiceDVD] saveCuesheet");
struct ddvd_resume resume_info;
ddvd_get_resume_pos(m_ddvdconfig, &resume_info);
if (resume_info.title)
{
struct ddvd_time info;
ddvd_get_last_time(m_ddvdconfig, &info);
pts_t pos;
pos = info.pos_hours * 3600;
pos += info.pos_minutes * 60;
pos += info.pos_seconds;
pos *= 90000;
m_cue_pts = pos;
eDebug("[eServiceDVD] ddvd_get_resume_pos resume_info.title=%d, chapter=%d, block=%lu, audio_id=%d, audio_lock=%d, spu_id=%d, spu_lock=%d (pts=%llu)",resume_info.title,resume_info.chapter,resume_info.block,resume_info.audio_id, resume_info.audio_lock, resume_info.spu_id, resume_info.spu_lock,m_cue_pts);
}
else
{
eDebug("[eServiceDVD] we're in a menu or somewhere else funny. so save cuesheet with pts=0");
m_cue_pts = 0;
}
/* CVR This first file search to the m_ref.path/dvd.cuts is very questionable but since a really ,
do not have a clue why it is there I leave it for the time being.
But in openpli only the if (f == NULL) file patch location and name is used.
Thats why To avoid a usseles saving off file with o position, and to remove an eventual existing file,
The only right location off extra code is where I did it. */
FILE* f;
{
std::string filename = m_ref.path;
filename += "/dvd.cuts";
f = fopen(filename.c_str(), "wb");
}
if (f == NULL)
{
char filename[128];
if ( m_ddvd_titlestring[0] != '\0' )
snprintf(filename, sizeof(filename), "/home/root/dvd-%s.cuts", m_ddvd_titlestring);
else
{
struct stat st;
if (stat(m_ref.path.c_str(), &st) == 0)
{
// DVD has no name and cannot be written. Use the mtime to generate something unique...
snprintf(filename, 128, "/home/root/dvd-%lx.cuts", st.st_mtime);
}
else
{
strcpy(filename, "/home/root/dvd-untitled.cuts");
}
}
/* CVR it does not make sense to keep a resume file with position 0 */
if (m_cue_pts == 0)
{
if (::access(filename, F_OK) == 0)
remove(filename);
}
else
{
eDebug("[eServiceDVD] saveCuesheet filename=%s",filename);
f = fopen(filename, "wb");
}
}
if (f)
{
unsigned long long where;
int what;
where = htobe64(m_cue_pts);
what = htonl(3);
fwrite(&where, sizeof(where), 1, f);
fwrite(&what, sizeof(what), 1, f);
what = htonl(4);
fwrite(&resume_info, sizeof(struct ddvd_resume), 1, f);
fwrite(&what, sizeof(what), 1, f);
fclose(f);
}
}
This procedure which starts (also present by loadcuesheet() ) seems completely usseless. And like You said if such file would really exists .... We are at the wild west in my opinion.
/* CVR This first file search to the m_ref.path/dvd.cuts is very questionable but since a really ,
do not have a clue why it is there I leave it for the time being.
But in openpli only the if (f == NULL) file patch location and name is used.
Thats why To avoid a usseles saving off file with o position, and to remove an eventual existing file,
The only right location off extra code is where I did it. */
FILE* f;
{
std::string filename = m_ref.path;
filename += "/dvd.cuts";
f = fopen(filename.c_str(), "wb");
}
The patch is not a final to push , but in my opinion that code above is .......
And unless someone can tell me the use off it off course we remove it. And keep that based on the dvd title. Which on it is very bright .