Opened 17 years ago

Closed 17 years ago

#3392 closed patch (fixed)

Fix asFileNotFound handling for remote files and storage groups

Reported by: sphery <mtdean@…> Owned by: cpinkham
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The introduction of Storage Groups created a minor bug in asFileNotFound handling in PlaybackBox?. Basically, there's a race between RemoteCheckFile?() and ProgramInfo::GetPlaybackURL()--each of which changes the ProgramInfo?'s pathname--that may cause the FileNotFoundActionPopup? to be shown for a file which is available for streaming from a backend if the file is not available locally.

The Gory Details:

The PlaybackBox::updateVideo() function calls PlaybackBox::fileExists() to determine whether a file is available before beginning to play the video preview. Since fileExists() calls ProgramInfo::PathnameExists?(), which calls RemoteCheckFile?(), the ProgramInfo?'s pathname gets changed to the local pathname of the recording file, regardless of whether that local pathname is accessible on this host. (This behavior of RemoteCheckFile?() also caused the issue in #2763.)

If the recording file is not available locally and PlaybackBox::showActions() is called after RemoteCheckFile?() sets the path to the local path but before updateVideo() calls PlaybackBox::startPlayer(), showFileNotFoundActionPopup() will be called, even if the file is available for streaming. If, however, updateVideo() calls startPlayer() before showActions() is called, startPlayer() will call ProgramInfo::GetPlaybackURL(), which will eventually determine that the file is not available locally and reset the pathname to a myth:// URL. (Note that showActions() can be accessed by hitting Right with UseArrowAccels? enabled.)

If the pathname is a myth:// URL, calls to PathnameExists?() result in RemoteCheckFile?(), being called, so the real available status will be determined (although this call will also cause the pathname to be changed). Therefore, since PlaybackBox::updateVideo() calls PlaybackBox::fileExists(), which calls ProgramInfo::PathnameExists?(), if the pathname is set to a not-available-to-this-host local pathname at the time showActions() is called, the FileNotFoundActionPopup? is shown. If, instead, the pathname is set to a myth:// URL, showActions() will correctly show the ActionPopup?.

Because of the keep-trying design of updateVideo(), once the user dismisses the FileNotFoundActionPopup?, the preview will begin playing normally. However, even while the preview video is playing, the user will be unable to play the recording using right or P buttons because the ProgramInfo?'s availableStatus has been set to asFileNotFound.

A very patient user with preview videos enabled is unlikely to see this issue as there's only a small amount of time (about 2 seconds with HDTV and less with SDTV) between the call to RemoteCheckFile?() and GetPlaybackURL(). Also, users who do not trigger the showActions() function (i.e. by just hitting the P button to play the recording) will not see the issue. However, anyone who hits right twice from the left column of the PlaybackBox? will likely trigger the bug. Upon doing so, they must exit and re-enter the Watch Recordings screen to get another chance (and are likely to be very confused when the preview plays but Myth says the file doesn't exist).

The asFileNotFound handling issue exists regardless of the AlwaysStreamFiles? and MasterBackendOverride? settings as RemoteCheckFile?() will still overwrite the pathname with a local (unavailable) path.

Therefore, I think the proper fix for this is to prevent the pathname from being changed to the local pathname when the file is not available locally. The attached patch takes this approach. If there is a reason for the pathname to be changed to the not-available-to-this-host local path of the file, please let me know. I had taken two other approaches to fixing this issue (so I could easily recreate those patches), but this one seemed to be the most appropriate fix as it always prevents the pathname from being set to an unavailable local path rather than fixing only showActions().

For reference, I have 2 dedicated backends and one remote frontend. Each backend has its own storage and I am not using any network filesystems to share files.

Attachments (1)

mythtv-remoteutil-local_pathname-recording_not_available.patch (662 bytes) - added by sphery <mtdean@…> 17 years ago.

Download all attachments as: .zip

Change History (3)

Changed 17 years ago by sphery <mtdean@…>

comment:1 Changed 17 years ago by cpinkham

Owner: changed from Isaac Richards to cpinkham

comment:2 Changed 17 years ago by cpinkham

Resolution: fixed
Status: newclosed

(In [13468]) Fix asFileNotFound handling for remote files and storage groups.

Modifies RemoteCheckFile?() so that it does not update pginfo->pathname unless the file is available locally.

Patch by Michael T. Dean.

Closes #3392.

Note: See TracTickets for help on using tickets.