summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--Makefile1
-rw-r--r--Todo1
-rw-r--r--video.c57
4 files changed, 38 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index e9cef03..fad0174 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
User johns
Date:
+ Add A-V info output and compile time option.
Fix bug: VA-API intel software decoder broken by aspect commit.
Add support for 4:3 output modes.
Quicker auto-crop after channel switch.
diff --git a/Makefile b/Makefile
index 257dae0..e3e07d7 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ GIT_REV = $(shell git describe --always 2>/dev/null)
### Configuration (edit this for your needs)
CONFIG := #-DDEBUG
+CONFIG += -DAV_INFO
#CONFIG += -DHAVE_PTHREAD_NAME
CONFIG += $(shell pkg-config --exists vdpau && echo "-DUSE_VDPAU")
CONFIG += $(shell pkg-config --exists libva && echo "-DUSE_VAAPI")
diff --git a/Todo b/Todo
index 8de7201..1907724 100644
--- a/Todo
+++ b/Todo
@@ -51,6 +51,7 @@ libva:
yaepghd (VaapiSetOutputPosition) support
can associate only displayed part of osd
grab image for va-api
+ remove stderr output of libva init
still many: (workaround export NO_MPEG_HW=1)
[drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[drm:i915_wait_request] *ERROR* i915_wait_request returns -11 ...
diff --git a/video.c b/video.c
index c601c34..3f69277 100644
--- a/video.c
+++ b/video.c
@@ -338,6 +338,29 @@ static int64_t VideoDeltaPTS; ///< FIXME: fix pts
static void VideoThreadLock(void); ///< lock video thread
static void VideoThreadUnlock(void); ///< unlock video thread
+#if defined(DEBUG) || defined(AV_INFO)
+///
+/// Nice time-stamp string.
+///
+static const char *VideoTimeStampString(int64_t ts)
+{
+ static char buf[64];
+ int hh;
+ int mm;
+ int ss;
+ int uu;
+
+ ts = ts / 90;
+ uu = ts % 1000;
+ ss = (ts / 1000) % 60;
+ mm = (ts / 60000) % 60;
+ hh = ts / 3600000;
+ snprintf(buf, sizeof(buf), "%2d:%02d:%02d.%03d", hh, mm, ss, uu);
+
+ return buf;
+}
+#endif
+
///
/// Update video pts.
///
@@ -3683,6 +3706,7 @@ static void VaapiAdvanceFrame(void)
} else if (filled == 1) {
++decoder->FramesDuped;
decoder->DropNextFrame = 0;
+ // FIXME: don't warn after stream start
Warning(_
("video: display buffer empty, duping frame (%d/%d) %d\n"),
decoder->FramesDuped, decoder->FrameCounter,
@@ -3837,20 +3861,14 @@ static void VaapiSyncDisplayFrame(VaapiDecoder * decoder)
decoder->DropNextFrame = 1;
}
}
-#ifdef DEBUG
+#if defined(DEBUG) || defined(AV_INFO)
// debug audio/video sync
if (decoder->DupNextFrame || decoder->DropNextFrame
|| !(decoder->FramesDisplayed % (50 * 10))) {
- static int64_t last_video_clock;
-
- Debug(3,
- "video: %6" PRId64 " %6" PRId64 " pts %+4d %4" PRId64 " %+4" PRId64
- " ms %3d bufs\n", video_clock - last_video_clock,
- audio_clock - video_clock, (int)(audio_clock - video_clock) / 90,
- AudioGetDelay() / 90, VideoDeltaPTS / 90,
- atomic_read(&VideoPacketsFilled));
-
- last_video_clock = video_clock;
+ Info("video: %s%+5" PRId64 " %4" PRId64 " %3d/\\ms %3d v-buf\n",
+ VideoTimeStampString(video_clock),
+ (video_clock - audio_clock) / 90, AudioGetDelay() / 90,
+ (int)VideoDeltaPTS / 90, atomic_read(&VideoPacketsFilled));
}
#endif
}
@@ -6620,6 +6638,7 @@ static void VdpauAdvanceFrame(void)
// keep use of last surface
++decoder->FramesDuped;
decoder->DropNextFrame = 0;
+ // FIXME: don't warn after stream start
Warning(_
("video: display buffer empty, duping frame (%d/%d) %d\n"),
decoder->FramesDuped, decoder->FrameCounter,
@@ -6775,20 +6794,14 @@ static void VdpauSyncDisplayFrame(VdpauDecoder * decoder)
decoder->DropNextFrame = 1;
}
}
-#ifdef DEBUG
+#if defined(DEBUG) || defined(AV_INFO)
// debug audio/video sync
if (decoder->DupNextFrame || decoder->DropNextFrame
|| !(decoder->FramesDisplayed % (50 * 10))) {
- static int64_t last_video_clock;
-
- Debug(3,
- "video: %6" PRId64 " %6" PRId64 " pts %+4d %4" PRId64 " %+4" PRId64
- " ms %3d bufs\n", video_clock - last_video_clock,
- audio_clock - video_clock, (int)(audio_clock - video_clock) / 90,
- AudioGetDelay() / 90, VideoDeltaPTS / 90,
- atomic_read(&VideoPacketsFilled));
-
- last_video_clock = video_clock;
+ Info("video: %s%+5" PRId64 " %4" PRId64 " %3d/\\ms %3d v-buf\n",
+ VideoTimeStampString(video_clock),
+ (video_clock - audio_clock) / 90, AudioGetDelay() / 90,
+ (int)VideoDeltaPTS / 90, atomic_read(&VideoPacketsFilled));
}
#endif
}