﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
11371	DVD video sometimes freezes briefly	peper03@…	peper03	"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."	Patch - Bug Fix	closed	minor	0.27	MythTV - DVD Playback	Master Head	medium	Fixed			0
