Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#12146 closed Developer Task (fixed)

In progress recordings do not always have up to date size/duration

Reported by: JYA Owned by: jpoet
Priority: minor Milestone: 0.27
Component: MythTV - Video Playback Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no

Description

MythPlayer keeps internally the total number of frames of the video being played and its duration.

Those two values will be updated when the position map is updated by the decoder, when it finds an inconsistencies between the position being played and its size.

When the position map is updated, the decoder will call back MythPlayer::SetFileLength is called.

MythPlayer itself can force an update to the position map when calling TranslatePositionFrameToMs or TranslatePositionMsToFrame.

this will call DecoderBase::TranslatePositionFrameToMs which in turn will check that the position map has information required. If not it will force a call to SyncPositionMap() which in turn will call back MythPlayer::SetFileLength

There is an issue however, in that from time to time, a call to TranslatePositionFrameToMs with a total frame count that is completely inaccurate doesn't trigger a call to SyncPositionMap() which results in an incorrect calculated value.

This cause failure to seek in an in progress recording (or last liveTV program).

Why would the position map not be refreshed when you attempt to seek into a position is the core issue.

Right now, I've added some workaround in places that required an up to date value of MythPlayer::totalFrames: in MythPlayer::CalcMaxFFTime and MythPlayer::FindFrame but I feel that this is just a dirty work around, and that earlier call to TranslatePositionFrameToMs and TranslatePositionFrameToMs should have forced an update...

To test, attached is a patch that makes the backend records 3 minutes recordings in liveTV.

To test, start liveTV and let it go until it jumps to the next program (it will occur before 3 minutes). Make sure you are playing live (within a few seconds of the actual end position). After about a minute rewind.

In MythPlayer::Rewind() have a breakpoint on

        float current = ComputeSecs(framesPlayed, true);

You can verify here that framesPlayed is superior to totalFrames , which signal an inconsistency.

ComputeSecs calls TranslatePositionFrameToMs, which should force an update to the position map. but it doesn't

Attachments (1)

livetv3min.patch (2.8 KB ) - added by JYA 11 years ago.

Download all attachments as: .zip

Change History (5)

by JYA, 11 years ago

Attachment: livetv3min.patch added

comment:1 by Jean-Yves Avenard <jyavenard@…>, 11 years ago

Resolution: fixed
Status: newclosed

In 244ce4feecd1df80c915023540a73684140d037a/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:2 by JYA, 11 years ago

Actually, what fix the issue was: 632cf60862dd106f89db4121b7c592e37694cd58

comment:3 by Jean-Yves Avenard <jyavenard@…>, 11 years ago

In fc6e69a3e8aaeb8c956a7e01ec170f1b7c073f36/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:4 by paulh, 11 years ago

Milestone: unknown0.27
Note: See TracTickets for help on using tickets.