Opened 11 years ago

Closed 9 years ago

#11730 closed Bug Report - General (Fixed)

Playback doesn't exit at the end of playback

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

Description

When playback reaches the end of the program; it just pause showing the last frame and never exit. Must press exit to go back to previous screen

Attachments (3)

mthfrontend.log (69.6 KB) - added by JYA 11 years ago.
11730.patch (577 bytes) - added by Jim Stichnoth 11 years ago.
11730.alt.patch (668 bytes) - added by Mark Spieth 11 years ago.
alternate root cause patch. Tested

Download all attachments as: .zip

Change History (13)

Changed 11 years ago by JYA

Attachment: mthfrontend.log added

comment:1 Changed 11 years ago by JYA

managed to reproduce it with a mp4 file. When the playback reaches the end, in about 3s there was over 53,000 lines of logs emitted on the console (without trimming those 2s of logs, the mythfrontend.log file was over 7MB)

comment:2 Changed 11 years ago by Mark Spieth

File segment with extra debugging

2013-08-13 00:46:05.893032 I  Player(0): FPS:   23.96 Mean: 41735 Std.Dev:  8380 CPUs: 20% 17% 
2013-08-13 00:46:08.059167 I  AFD: Key frame distance changed from 29 to 76.
2013-08-13 00:46:09.841955 I  Player(0): FPS:   24.06 Mean: 41560 Std.Dev:  8407 CPUs: 21% 24% 
2013-08-13 00:46:10.758244 E  decoding error
                        eno: Unknown error 541478725 (541478725)
2013-08-13 00:46:10.807853 I  waiting for no video frames 26 vd=0 ad=0 at=1459
2013-08-13 00:46:10.841134 I  waiting for no video frames 25 vd=0 ad=0 at=1425
2013-08-13 00:46:10.891156 I  waiting for no video frames 24 vd=0 ad=0 at=1375
2013-08-13 00:46:10.924482 I  waiting for no video frames 23 vd=0 ad=0 at=1342
2013-08-13 00:46:10.974494 I  waiting for no video frames 22 vd=0 ad=0 at=1292
2013-08-13 00:46:11.007804 I  waiting for no video frames 21 vd=0 ad=0 at=1259
2013-08-13 00:46:11.057769 I  waiting for no video frames 20 vd=0 ad=0 at=1209
2013-08-13 00:46:11.091082 I  waiting for no video frames 19 vd=0 ad=0 at=1175
2013-08-13 00:46:11.141085 I  waiting for no video frames 18 vd=0 ad=0 at=1125
2013-08-13 00:46:11.174422 I  waiting for no video frames 17 vd=0 ad=0 at=1092
2013-08-13 00:46:11.224376 I  waiting for no video frames 16 vd=0 ad=0 at=1042
2013-08-13 00:46:11.257699 I  waiting for no video frames 15 vd=0 ad=0 at=1009
2013-08-13 00:46:11.307712 I  waiting for no video frames 14 vd=0 ad=0 at=959
2013-08-13 00:46:11.340983 I  waiting for no video frames 13 vd=0 ad=0 at=926
2013-08-13 00:46:11.390997 I  waiting for no video frames 12 vd=0 ad=0 at=876
2013-08-13 00:46:11.424295 I  waiting for no video frames 11 vd=0 ad=0 at=842
2013-08-13 00:46:11.474308 I  waiting for no video frames 10 vd=0 ad=0 at=792
2013-08-13 00:46:11.507635 I  waiting for no video frames 9 vd=0 ad=0 at=759
2013-08-13 00:46:11.557626 I  waiting for no video frames 8 vd=0 ad=0 at=709
2013-08-13 00:46:11.590903 I  waiting for no video frames 7 vd=0 ad=0 at=676
2013-08-13 00:46:11.640912 I  waiting for no video frames 6 vd=0 ad=0 at=626
2013-08-13 00:46:11.674243 I  waiting for no video frames 5 vd=0 ad=0 at=592
2013-08-13 00:46:11.724223 I  waiting for no video frames 4 vd=0 ad=0 at=542
2013-08-13 00:46:11.757579 I  waiting for no video frames 3 vd=0 ad=0 at=509
2013-08-13 00:46:11.807541 I  waiting for no video frames 2 vd=0 ad=0 at=459
2013-08-13 00:46:11.857554 I  waiting for no video frames 1 vd=0 ad=0 at=409
2013-08-13 00:46:11.890820 I  waiting for no video frames 0 vd=1 ad=0 at=376
2013-08-13 00:46:11.940829 I  waiting for no video frames 0 vd=1 ad=0 at=326
2013-08-13 00:46:11.941813 I  Player(0): Video is 6.45864 frames behind audio (too slow), dropping frame to catch up.
2013-08-13 00:46:11.941822 I  AOBase: Pause 1
2013-08-13 00:46:11.941862 I  waiting for no video frames 0 vd=1 ad=0 at=325
2013-08-13 00:46:11.942718 I  Player(0): Video is 11.4374 frames behind audio (too slow), dropping frame to catch up.
2013-08-13 00:46:11.942724 I  AOBase: Pause 1
2013-08-13 00:46:11.942757 I  waiting for no video frames 0 vd=1 ad=0 at=324
2013-08-13 00:46:11.943720 I  Player(0): Video is 15.1775 frames behind audio (too slow), dropping frame to catch up.
2013-08-13 00:46:11.943727 I  AOBase: Pause 1
2013-08-13 00:46:11.943763 I  waiting for no video frames 0 vd=1 ad=0 at=323

It looks like audio is paused when video is done by something other than event loop thus audio will never drain! silence playback will keep it from emptying.

comment:3 Changed 11 years ago by Mark Spieth

Happens in AVSync on dropping frame detection.

Probably needs check for eof mode before choosing to pause audio.

Changed 11 years ago by Jim Stichnoth

Attachment: 11730.patch added

comment:4 Changed 11 years ago by Jim Stichnoth

Can you try applying 11730.patch?

Changed 11 years ago by Mark Spieth

Attachment: 11730.alt.patch added

alternate root cause patch. Tested

comment:5 Changed 11 years ago by Mark Spieth

Consequences of the 2 patches:

patch1 will exit when video frames are skipped and thus skip audio at end. Might as well remove end of audio test.

patch2 will exit with 100ms of audio left. Could reduce the threshold if desired.

both work.

comment:6 in reply to:  5 Changed 11 years ago by Jim Stichnoth

Replying to markspieth:

patch1 will exit when video frames are skipped and thus skip audio at end. Might as well remove end of audio test.

The end of audio test is still needed for audio-only recordings, otherwise they will exit playback prematurely.

comment:7 Changed 11 years ago by Jim Stichnoth <jstichnoth@…>

Resolution: fixed
Status: newclosed

In 8b542e208d6a11c9d5d43a32a07ca8b82e9f2185/mythtv:

Don't wait for paused audio to drain. Fixes #11730.

The problem is that MythPlayer::AVSync() might pause audio while
dropping a frame, and if this happens during the EOF A/V draining
period, it could wait forever for the audio to drain.

Alternatively or in addition, AVSync() could check that
GetEof?()!=kEofStateDelayed before pausing audio. Thanks to Mark
Spieth for the analysis.

comment:8 Changed 11 years ago by Karl Egly

Milestone: unknown0.27

comment:9 Changed 9 years ago by heather.ellis@…

Resolution: fixed
Status: closednew

comment:10 Changed 9 years ago by Karl Egly

Resolution: Fixed
Status: newclosed
Ticket locked: set

Thank you for your contribution, but when reopening a ticket after 1 1/2 years it would be helpful to provide additional information, like new logfiles or new symptoms. To avoid mixing up the old and presumed re-occuring issue it is best to open a new ticket. I'm closing this one again, to avoid confusion. Feel free to provide the information in a fresh ticket.

Note: See TracTickets for help on using tickets.