From c24ef592e77d6146983a3cf156e86f14dfcecd07 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Sun, 30 Apr 2017 12:37:15 +0100 Subject: [PATCH] Include Pixel Aspect Ratio in DebugTextViewHelper Add the video Pixel Aspect Ratio to the DebugTextViewHelper in order to help debug issues related to PAR changes etc --- .../android/exoplayer2/ui/DebugTextViewHelper.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java index 68fa6a8cc9..e65b475c97 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java @@ -163,9 +163,15 @@ public final class DebugTextViewHelper implements Runnable, ExoPlayer.EventListe if (format == null) { return ""; } + float par = format.pixelWidthHeightRatio; + String parInfo = ""; + if (par != Format.NO_VALUE && (int) par != 1) { + // Add pixel aspect ratio only when it's useful + parInfo = " par:" + format.pixelWidthHeightRatio; + } return "\n" + format.sampleMimeType + "(id:" + format.id + " r:" + format.width + "x" - + format.height + getDecoderCountersBufferCountString(player.getVideoDecoderCounters()) - + ")"; + + format.height + parInfo + + getDecoderCountersBufferCountString(player.getVideoDecoderCounters()) + ")"; } private String getAudioString() {