Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 5 years ago

Closed 16 months ago

Last modified 10 months ago

#6974 closed Patch - Bug Fix (fixed)

last few seconds of video are not played

Reported by: markspieth Owned by: stichnot
Priority: minor Milestone: 0.27
Component: MythTV - Video Playback Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description (last modified by markspieth)

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 markspieth 5 years ago.
mythtv-6974-IsNearEnd_margin_for_end_of_recording_prompt.patch (976 bytes) - added by mdean 5 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 markspieth 3 years ago.
mythtv-play-to-end.20120306.patch (10.4 KB) - added by markspieth 2 years ago.
updated reasonably current patch for play to end
mythtv-play-to-end.20121231.patch (11.2 KB) - added by markspieth 16 months ago.
current patch to ease integration
playtoend-jms.patch (11.1 KB) - added by stichnot 16 months ago.

Download all attachments as: .zip

Change History (25)

Changed 5 years ago by markspieth

comment:1 Changed 5 years ago by markspieth

  • Description modified (diff)

comment:2 Changed 5 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 5 years ago by mdean

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 5 years ago by mdean

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 5 years ago by markspieth

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 4 years ago by robertm

  • Owner changed from ijr to mdean
  • Status changed from new to assigned

comment:6 Changed 3 years ago by mdean

  • Resolution set to Won't Fix
  • Status changed from assigned to closed

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 3 years ago by markspieth

comment:7 Changed 3 years ago by markspieth

  • Resolution Won't Fix deleted
  • Status changed from closed to new

update to play to end patch.

reopening as a result.

comment:8 Changed 3 years ago by mdean

  • Status changed from new to accepted

comment:9 Changed 2 years ago by stuartm

  • Milestone changed from unknown to 0.25
  • Type changed from enhancement to Patch - Bug Fix
  • Version changed from unknown to Master Head

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

comment:10 Changed 2 years ago by stuartm

  • Owner changed from mdean to taylorr
  • Status changed from accepted to assigned

comment:11 Changed 2 years ago by stuartm

  • Component changed from MythTV - General to MythTV - Video Playback

Changed 2 years ago by markspieth

updated reasonably current patch for play to end

comment:12 Changed 2 years ago by stuartm

  • Owner changed from taylorr to tralph

comment:13 Changed 2 years ago by stichnot

  • Milestone changed from 0.25 to 0.26

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

comment:14 Changed 2 years ago by tralph

  • Owner tralph deleted
  • Status changed from assigned to new

comment:15 Changed 19 months ago by kenni

  • Milestone changed from 0.26 to 0.26.1

comment:16 Changed 16 months ago by stichnot

  • Milestone changed from 0.26.1 to 0.27
  • Owner set to stichnot
  • Status changed from new to accepted

Changed 16 months ago by markspieth

current patch to ease integration

comment:17 Changed 16 months 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 16 months ago by stichnot

comment:18 Changed 16 months ago by Jim Stichnoth <jstichnoth@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

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 10 months 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.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.