Skip to content

Commit 6bd46bf

Browse files
committed
Tweak debug messages.
1 parent e42d511 commit 6bd46bf

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

video.c

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,7 +2796,7 @@ static void VaapiPutSurfaceX11(VaapiDecoder * decoder, VASurfaceID surface, int
27962796
}
27972797
e = GetMsTicks();
27982798
if (e - s > 2000) {
2799-
Error("video/vaapi: gpu hung %dms %d", e - s, decoder->FrameCounter);
2799+
Error("video/vaapi: gpu hung %ums %d", e - s, decoder->FrameCounter);
28002800
}
28012801
}
28022802

@@ -3232,7 +3232,7 @@ static void VaapiBlackSurface(VaapiDecoder * decoder)
32323232

32333233
put1 = GetMsTicks();
32343234
if (put1 - sync > 2000) {
3235-
Error("video/vaapi: gpu hung %dms %d", put1 - sync, decoder->FrameCounter);
3235+
Error("video/vaapi: gpu hung %ums %d", put1 - sync, decoder->FrameCounter);
32363236
}
32373237
#ifdef DEBUG
32383238
Debug8("video/vaapi: sync %2u put1 %2u", sync - start, put1 - sync);
@@ -3449,8 +3449,7 @@ static void VaapiAdvanceDecoderFrame(VaapiDecoder * decoder)
34493449
if (filled <= 1) {
34503450
// keep use of last surface
34513451
++decoder->FramesDuped;
3452-
// FIXME: don't warn after stream start, don't warn during pause
3453-
Error("video: display buffer empty, duping frame (%d/%d) %d", decoder->FramesDuped, decoder->FrameCounter,
3452+
Debug("video: display buffer empty, duping frame (%u/%u) %d", decoder->FramesDuped, decoder->FrameCounter,
34543453
VideoGetBuffers(decoder->Stream));
34553454
return;
34563455
}
@@ -3604,9 +3603,7 @@ char *VaapiGetStats(VaapiDecoder * decoder)
36043603
if (snprintf(&buffer[0], sizeof(buffer),
36053604
" Frames: missed(%d) duped(%d) dropped(%d) total(%d) PTS(%s) drift(%" PRId64 ") audio(%" PRId64 ") video(%"
36063605
PRId64 ")", decoder->FramesMissed, decoder->FramesDuped, decoder->FramesDropped, decoder->FrameCounter,
3607-
Timestamp2String(video_clock),
3608-
abs((video_clock - audio_clock) / 90) < 8888 ? ((video_clock - audio_clock) / 90) : 8888,
3609-
AudioGetDelay() / 90, VideoDeltaPTS / 90)) {
3606+
Timestamp2String(video_clock), (video_clock - audio_clock) / 90, AudioGetDelay() / 90, VideoDeltaPTS / 90)) {
36103607
return strdup(buffer);
36113608
}
36123609

@@ -3719,24 +3716,24 @@ static void VaapiSyncDecoder(VaapiDecoder * decoder)
37193716
}
37203717

37213718
if (abs(diff) > 5000 * 90) { // more than 5s
3722-
err = VaapiMessage(1, "video: audio/video difference too big");
3719+
err = VaapiMessage(2, "video: audio/video difference too big");
37233720
} else if (diff > 100 * 90) {
37243721
// FIXME: this quicker sync step, did not work with new code!
3725-
err = VaapiMessage(1, "video: slow down video, duping frame");
3722+
err = VaapiMessage(2, "video: slow down video, duping frame");
37263723
++decoder->FramesDuped;
37273724
if (VideoSoftStartSync) {
37283725
decoder->SyncCounter = 1;
37293726
goto out;
37303727
}
37313728
} else if (diff > 55 * 90) {
3732-
err = VaapiMessage(1, "video: slow down video, duping frame");
3729+
err = VaapiMessage(2, "video: slow down video, duping frame");
37333730
++decoder->FramesDuped;
37343731
if (VideoSoftStartSync) {
37353732
decoder->SyncCounter = 1;
37363733
goto out;
37373734
}
37383735
} else if (diff < lower_limit * 90 && filled > 1 + 2 * decoder->Interlaced) {
3739-
err = VaapiMessage(1, "video: speed up video, droping frame");
3736+
err = VaapiMessage(2, "video: speed up video, droping frame");
37403737
++decoder->FramesDropped;
37413738
VaapiAdvanceDecoderFrame(decoder);
37423739
if (VideoSoftStartSync) {
@@ -3762,7 +3759,7 @@ static void VaapiSyncDecoder(VaapiDecoder * decoder)
37623759
++decoder->FramesDuped;
37633760
// FIXME: don't warn after stream start, don't warn during pause
37643761
err =
3765-
VaapiMessage(0, "video: decoder buffer empty, duping frame (%d/%d) %d v-buf", decoder->FramesDuped,
3762+
VaapiMessage(0, "video: decoder buffer empty, duping frame (%u/%u) %d v-buf", decoder->FramesDuped,
37663763
decoder->FrameCounter, VideoGetBuffers(decoder->Stream));
37673764
// some time no new picture
37683765
if (decoder->Closing < -300) {
@@ -3782,10 +3779,10 @@ static void VaapiSyncDecoder(VaapiDecoder * decoder)
37823779
VaapiMessage(0, NULL);
37833780
}
37843781
Info("video: %s%+5" PRId64 " %4" PRId64 " %3d/\\ms %3d%+d v-buf", Timestamp2String(video_clock),
3785-
abs((video_clock - audio_clock) / 90) < 8888 ? ((video_clock - audio_clock) / 90) : 8888,
3786-
AudioGetDelay() / 90, (int)VideoDeltaPTS / 90, VideoGetBuffers(decoder->Stream),
3787-
decoder->Interlaced ? (2 * atomic_read(&decoder->SurfacesFilled) - decoder->SurfaceField)
3788-
: atomic_read(&decoder->SurfacesFilled));
3782+
(video_clock - audio_clock) / 90, AudioGetDelay() / 90, (int)VideoDeltaPTS / 90,
3783+
VideoGetBuffers(decoder->Stream), decoder->Interlaced ?
3784+
(2 * atomic_read(&decoder->SurfacesFilled) - decoder->SurfaceField) :
3785+
atomic_read(&decoder->SurfacesFilled));
37893786
if (!(decoder->FramesDisplayed % (5 * 60 * 60))) {
37903787
VaapiPrintFrames(decoder);
37913788
}

0 commit comments

Comments
 (0)