Bug #1172 ยป greater_sync_2.diff
| video.c | ||
|---|---|---|
|
goto out;
|
||
|
}
|
||
|
// both clocks are known
|
||
|
if (audio_clock + VideoAudioDelay <= video_clock + 15 * 90) {
|
||
|
if (audio_clock + VideoAudioDelay <= video_clock + 35 * 90) {
|
||
|
goto out;
|
||
|
}
|
||
|
// out of sync: audio before video
|
||
| ... | ... | |
|
++decoder->FramesDuped;
|
||
|
decoder->SyncCounter = 1;
|
||
|
goto out;
|
||
|
} else if (video_clock > audio_clock + VideoAudioDelay + 45 * 90) {
|
||
|
} else if (video_clock > audio_clock + VideoAudioDelay + 65 * 90) {
|
||
|
err = VaapiMessage(3, "video: slow down video, duping frame\n");
|
||
|
++decoder->FramesDuped;
|
||
|
decoder->SyncCounter = 1;
|
||
|
goto out;
|
||
|
} else if (audio_clock + VideoAudioDelay > video_clock + 15 * 90
|
||
|
} else if (audio_clock + VideoAudioDelay > video_clock + 35 * 90
|
||
|
&& filled > 1 + 2 * decoder->Interlaced) {
|
||
|
err = VaapiMessage(3, "video: speed up video, droping frame\n");
|
||
|
++decoder->FramesDropped;
|
||
| ... | ... | |
|
goto out;
|
||
|
}
|
||
|
// both clocks are known
|
||
|
if (audio_clock + VideoAudioDelay <= video_clock + 15 * 90) {
|
||
|
if (audio_clock + VideoAudioDelay <= video_clock + 35 * 90) {
|
||
|
goto out;
|
||
|
}
|
||
|
// out of sync: audio before video
|
||
| ... | ... | |
|
++decoder->FramesDuped;
|
||
|
decoder->SyncCounter = 1;
|
||
|
goto out;
|
||
|
} else if (video_clock > audio_clock + VideoAudioDelay + 45 * 90) {
|
||
|
} else if (video_clock > audio_clock + VideoAudioDelay + 65 * 90) {
|
||
|
err = VdpauMessage(2, "video: slow down video, duping frame\n");
|
||
|
++decoder->FramesDuped;
|
||
|
decoder->SyncCounter = 1;
|
||
|
goto out;
|
||
|
} else if (audio_clock + VideoAudioDelay > video_clock + 15 * 90
|
||
|
} else if (audio_clock + VideoAudioDelay > video_clock + 35 * 90
|
||
|
&& filled > 1 + 2 * decoder->Interlaced) {
|
||
|
err = VdpauMessage(2, "video: speed up video, droping frame\n");
|
||
|
++decoder->FramesDropped;
|
||