Immediate A-V desync disables video-sync #3610

Closed
andreaskem opened this Issue Oct 1, 2016 · 3 comments

Projects

None yet

2 participants

@andreaskem

mpv version and platform

mpv 0.20.0 and git master
x86-64 Linux (up-to-date Arch Linux)
ffmpeg 3.1.3

Reproduction steps

Preface: I am not sure if the file really is broken.
Play the example file uploaded to the address given below with mpv:

mpv --no-config -v --video-sync=display-resample TWBB_test.mkv

(The attached example file is the beginning of a DVD rip created using makemkv. The extraction of the first 5 seconds was performed using mkvtoolnix. The original file shows the same behavior. I am not 100% sure if the file is corrupted or not and do not really know how to check. I do not know in what way the file could be corrputed. mkvinfo does not report a problem and other DVD rips created by makemkv do not exhibit this problem.)

Expected behavior

mpv plays the file without a warning and enables video sync.

Actual behavior

mpv immediately detects A-V desynchronization and seems to disable display sync:

[   1.246][w][cplayer] 
[   1.246][w][cplayer] Audio/Video desynchronisation detected! Possible reasons include too slow
[   1.246][w][cplayer] hardware, temporary CPU spikes, broken drivers, and broken files. Audio
[   1.246][w][cplayer] position will not match to the video (see A-V status field).
[   1.246][w][cplayer] 
[   1.246][v][cplayer] Change display sync audio drift: 1
[   1.270][v][cplayer] Video sync mode disabled.

The A-V drift seems to normalize quickly but display sync does not seem to get reactivated automatically. If I seek forward, DS seems to get reactivated. If I seek to the beginning of the file, it gets deactivated again and stays off. This behavior seems very odd.

Log files

http://sprunge.us/WUZf

Sample files

https://0x0.st/1Pz.mkv

@wm4
Member
wm4 commented Oct 2, 2016

It desyncs because audio starts late. Normally it should wait until audio starts, and this is a regression that was probably caused by a bug fix.

@wm4 wm4 added a commit that closed this issue Oct 2, 2016
@wm4 wm4 audio: fix late audio start
Regression since commit bbcd0b6. This code is just cursed, because it's
a fragile state machine with no proper tests, and which could be done in
a much simpler way. Without doubt this change will cause a regression in
some ridiculous corner case as well.

Fixes #3610 (the cause of it, not the behavior it resulted in).
3a5cbf3
@wm4 wm4 closed this in 3a5cbf3 Oct 2, 2016
@wm4
Member
wm4 commented Oct 2, 2016

Fixed the desync. The DS disable behavior will stay the way it is.

@andreaskem

My file plays perfectly now with this fix. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment