Opened 12 years ago
Closed 11 years ago
#11371 closed Patch - Bug Fix (Fixed)
DVD video sometimes freezes briefly
Reported by: | Owned by: | peper03 | |
---|---|---|---|
Priority: | minor | Milestone: | 0.27 |
Component: | MythTV - DVD Playback | Version: | Master Head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
When playing DVDs such as Cars 2 or Brave using VDPAU or with the 'Extra audio buffering' option enabled, the video sometimes freezes for a couple of seconds.
This is because the audio timestamp has jumped backwards (from say 20000 to 47). The condition in AvFormatDecoder::GetFrame? ('lastapts < lastvpts + 100') that determines whether to continue buffering video frames always evaluates to true because lastvpts does not get updated until a frame is actually processed, which it won't because the video frames keep getting buffered.
This situation continues until either the audio buffer fills up (setting 'allowedquit' to true and breaking out of the loop) or until the maximum number of video frames have been buffered (currently 220). If the input data cannot be read quickly enough (e.g. when reading from a physical DVD rather than an image), the picture freezes for around 2 seconds.
The exact behaviour depends on the input reading speed and the configured audio output (7.1 analogue output will fill the audio buffers faster than stereo or SPDIF).
The attached patch detects when the audio timestamp jumps backwards and prevents more video frames from being buffered until the frames already in the buffer have been processed and the video timestamp has also jumped backwards.
Attachments (4)
Change History (9)
Changed 12 years ago by
Attachment: | 0001-Detect-when-the-audio-timestamp-resets-to-ensure-we-.patch added |
---|
Changed 12 years ago by
Attachment: | 0001-DVD-PTS-discontinuities-are-now-handled-by-flattenin.patch added |
---|
Changed 12 years ago by
Attachment: | timestamp_bad.txt added |
---|
Logs of problem before patch (using VDPAU decoding and analogue stereo output)
Changed 12 years ago by
Attachment: | timestamp_good.txt added |
---|
Logs after applying 2nd patch (sync traces on 'lba' parameter)
comment:1 Changed 12 years ago by
The second patch approaches the problem from a different direction by detecting PTS discontinuities and flattening them so that no matter how much the user jumps about, the timecodes should always be contiguous.
The sample 'Cars2Titles.iso' in stuartm's DVD repository contains a small excerpt from the opening credits of Cars 2. The point at which the '2' comes together is approximately where the timecodes jump back and cause problems.
comment:2 Changed 12 years ago by
Owner: | set to Jim Stichnoth |
---|---|
Status: | new → accepted |
Second patch committed in b6c0ec5529d8b921a846c38b5d6afeb06a4d5671
comment:4 Changed 11 years ago by
Owner: | changed from Jim Stichnoth to peper03 |
---|---|
Status: | accepted → assigned |
comment:5 Changed 11 years ago by
Milestone: | unknown → 0.27 |
---|---|
Resolution: | → Fixed |
Status: | assigned → closed |
New patch that flattens DVD timestamps to avoid PTS jumps.