Opened 9 years ago

Closed 5 years ago

Last modified 5 years ago

#6974 closed Patch - Bug Fix (fixed)

last few seconds of video are not played

Reported by: Mark Spieth Owned by: Jim Stichnoth
Priority: minor Milestone: 0.27
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by Mark Spieth)

when a recording or video is played, the last few seconds are not played.

There are 2 reasons for this:

  1. appended audio with no more video is sent and discarded but the audiooutput.

so if not paused, feed the audio into the output buffer carefully but not with infinite wait.

  1. eof is detected and any frames in the queue are discarded.

delay eof activation until all frames are played

needs some testing with unusual cases such as audio only and video only.

also see #4359

this is another of my annoyances fixed.

patch attached.

Attachments (6)

play-to-end.patch (13.9 KB) - added by Mark Spieth 9 years ago.
mythtv-6974-IsNearEnd_margin_for_end_of_recording_prompt.patch (976 bytes) - added by sphery 9 years ago.
Allows playing recording closer to the end when end-of-recording prompt is enabled. Must be used with play-to-end.patch .
16-play-to-end (8.9 KB) - added by Mark Spieth 8 years ago.
mythtv-play-to-end.20120306.patch (10.4 KB) - added by Mark Spieth 6 years ago.
updated reasonably current patch for play to end
mythtv-play-to-end.20121231.patch (11.2 KB) - added by Mark Spieth 5 years ago.
current patch to ease integration
playtoend-jms.patch (11.1 KB) - added by Jim Stichnoth 5 years ago.

Download all attachments as: .zip

Change History (25)

Changed 9 years ago by Mark Spieth

Attachment: play-to-end.patch added

comment:1 Changed 9 years ago by Mark Spieth

Description: modified (diff)

comment:2 Changed 9 years ago by anonymous

This is great news if this patch fixes the problem - I really hope this patch gets applied. Also see http://svn.mythtv.org/trac/ticket/6148 which is a ticket opened after the last fix didn't work.

Changed 9 years ago by sphery

Allows playing recording closer to the end when end-of-recording prompt is enabled. Must be used with play-to-end.patch .

comment:3 Changed 9 years ago by sphery

I attached a patch, mythtv-6974-IsNearEnd_margin_for_end_of_recording_prompt.patch , which should be used in conjunction with Mark's play-to-end.patch .

mythtv-6974-IsNearEnd_margin_for_end_of_recording_prompt.patch changes TV::HandleEndOfRecordingExitPromptTimerEvent?() to check to see if we're within 1/3 second of the end of the recording when determining whether to display the end-of-recording prompt. Without the patch, it's checking to see if we're within 2 seconds of the end of the recording, meaning we display the end-of-recording prompt about 2 seconds from the end of the recording. The patch factors in timestretch when calculating the 1/3-second margin and, due to the timer's checking for the end of the recording every 1/4 second, seemed to work reliably on my systems in all cases. If 1/3 second isn't reliable on all systems/video files, it could be increased to 1/2 second.

Note that mythtv-6974-IsNearEnd_margin_for_end_of_recording_prompt.patch can *not* be used without play-to-end.patch , as we'll hit the issues Mark mentioned before the prompt is displayed and exit back to the Watch Recordings screen without ever displaying the prompt for those users who have enabled the end-of-recording prompt. This is probably why we're currently using a 2-second margin.

Note that the 2-second margin is the issue reported in #6418 , mentioned above.

comment:4 Changed 9 years ago by Mark Spieth

I was thinking of handling the prompt with a secondary loop outside the main loop which is activated on eof exit and prompt menu is required. That way it will truely be the end and no nearness test is required.

one of the menu options isnt needed as you cant go back and play more (cancel) because you are at the end already.

Havent had time to implement yet.

comment:5 Changed 8 years ago by robertm

Owner: changed from Isaac Richards to sphery
Status: newassigned

comment:6 Changed 8 years ago by sphery

Resolution: Won't Fix
Status: assignedclosed

As mentioned in http://www.gossamer-threads.com/lists/mythtv/dev/452617#452617 , play-to-end.patch is no longer working as intended, and mythtv-6974-IsNearEnd_margin_for_end_of_recording_prompt.patch relies on play-to-end.patch (but should be reimplemented as at comment:4 , anyway), so since we don't have any usable patches for this ticket, I'm closing it for now. Anyone should feel free to reopen the ticket with an updated/fixed patch(es).

Changed 8 years ago by Mark Spieth

Attachment: 16-play-to-end added

comment:7 Changed 8 years ago by Mark Spieth

Resolution: Won't Fix
Status: closednew

update to play to end patch.

reopening as a result.

comment:8 Changed 8 years ago by sphery

Status: newaccepted

comment:9 Changed 6 years ago by stuartm

Milestone: unknown0.25
Type: enhancementPatch - Bug Fix
Version: unknownMaster Head

Maybe this won't get fixed for 0.25, but it is a bug with a patch supplied so ...

comment:10 Changed 6 years ago by stuartm

Owner: changed from sphery to taylorr
Status: acceptedassigned

comment:11 Changed 6 years ago by stuartm

Component: MythTV - GeneralMythTV - Video Playback

Changed 6 years ago by Mark Spieth

updated reasonably current patch for play to end

comment:12 Changed 6 years ago by stuartm

Owner: changed from taylorr to tralph

comment:13 Changed 6 years ago by Jim Stichnoth

Milestone: 0.250.26

Pushing back to 0.26, but could go into 0.25-fixes.

comment:14 Changed 6 years ago by tralph

Owner: tralph deleted
Status: assignednew

comment:15 Changed 6 years ago by Kenni Lund [kenni a kelu dot dk]

Milestone: 0.260.26.1

comment:16 Changed 5 years ago by Jim Stichnoth

Milestone: 0.26.10.27
Owner: set to Jim Stichnoth
Status: newaccepted

Changed 5 years ago by Mark Spieth

current patch to ease integration

comment:17 Changed 5 years ago by Jim Stichnoth <jstichnoth@…>

In 91ec76e8afba1833a7cb64f17429910f29b39404/mythtv:

Play closer to the end of the video.

Refs #6974. When the end of the recording is reached, don't exit the
player immediately. Instead, pause playback and let exiting be
handled by either the end-of-playback timer event or the
end-of-recording-delete-prompt timer event. This removes IsNearEnd?()
from end-of-playback consideration, as well as the randomness of where
in the 250ms window the timer events fire.

IsNearEnd?() is still used in other places (e.g. to control playback
speed and bookmarking behavior near the end of a recording). The
IsNearEnd?() calculation is changed to depend on the number of frames
played by the player rather than the number of frames read by the
decoder thread, making IsNearEnd?() more predictable and reliable.

Note that this does not address the original issue in #6974, which
involves allowing the accumulated decoded frames to be displayed after
the decoder reaches EOF.

Changed 5 years ago by Jim Stichnoth

Attachment: playtoend-jms.patch added

comment:18 Changed 5 years ago by Jim Stichnoth <jstichnoth@…>

Resolution: fixed
Status: acceptedclosed

In 31126568be61528ed05eef04ca0bf7f0a3d4b004/mythtv:

Fixes #6974. Play all the way to the end of the video.

Playback is allowed to continue even after the decoder thread reaches
the EOF state, until decoded and buffered frames are drained from the
decoder. This may represent anywhere from 0.25s to 1s of content.

Thanks to Mark Spieth for providing and maintaining the patch.

comment:19 Changed 5 years ago by Jim Stichnoth <jstichnoth@…>

In cef316f803117339a3e954531aedd00b462a81e9/mythtv:

Avoid premature playback exit for audio-only recordings.

Stop playback only when the decoder, video output, and audio output
all drain. Refs #11357. Refs #6974.

Note: See TracTickets for help on using tickets.