xbmc/xbmc — pull request #2952 by jmbreuer (2013-07-08 09:49:32+00:00)
Title: Fix DVD resume: Get and use correct (removable://) file record from database

Currently, DVD resume only works once - i.e., when first stopping DVD playback a resume record is created, which is used when playing this DVD again.

(But: See also https://github.com/xbmc/xbmc/pull/2940 and https://github.com/xbmc/xbmc/pull/2951)

Updating this existing resume / playerstate record does **not** work.

I traced this to `CVideoDatabase::GetFileInfo()`, where the `removable://DVD_` path in `CVideoInfoTag.m_strFileNameAndPath` is overwritten with information obtained from the 'wrong' place in the VideoDB; namely the record for `iso9660://VIDEO_TS/VIDEO_TS.IFO` is used (which cannot discern between different disks).
The overwritten name `iso9660://VIDEO_TS/VIDEO_TS.IFO` is then later used to find the resume record to be updated, which cannot work since this record is not disk-specific and will not be used/read by `CApplication::PlayFile()` / `CVideoDatabase::GetResumeBookMark()`.

In the attached patch, I've changed `GetFileInfo()` to return the DB record for the `removable://DVD_` path; in the same manner that is used in a number of other places as well; e.g. in `CSaveFileStateJob::DoWork()` and `CApplication::PlayFile()` where access to a disk-specific record is intended.

With this patch (including the prerequisites mentioned above), successively updating the DVD resume / playerState record works fine here.