Fix reporting of width/height

1. maybeRenotifyVideoSizeChanged should report reported* variables
2. Add check into maybeNotifyVideoSizeChanged to suppress reporting
   in the case that the width and height are still unknown.

Issue: #3007

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160879625
This commit is contained in:
olly 2017-07-04 03:32:23 -07:00 committed by Oliver Woodman
parent 37faead26e
commit dda3616f5a

View File

@ -700,9 +700,10 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
}
private void maybeNotifyVideoSizeChanged() {
if (reportedWidth != currentWidth || reportedHeight != currentHeight
if ((currentWidth != Format.NO_VALUE || currentHeight != Format.NO_VALUE)
&& (reportedWidth != currentWidth || reportedHeight != currentHeight
|| reportedUnappliedRotationDegrees != currentUnappliedRotationDegrees
|| reportedPixelWidthHeightRatio != currentPixelWidthHeightRatio) {
|| reportedPixelWidthHeightRatio != currentPixelWidthHeightRatio)) {
eventDispatcher.videoSizeChanged(currentWidth, currentHeight, currentUnappliedRotationDegrees,
currentPixelWidthHeightRatio);
reportedWidth = currentWidth;
@ -714,8 +715,8 @@ public class MediaCodecVideoRenderer extends MediaCodecRenderer {
private void maybeRenotifyVideoSizeChanged() {
if (reportedWidth != Format.NO_VALUE || reportedHeight != Format.NO_VALUE) {
eventDispatcher.videoSizeChanged(currentWidth, currentHeight, currentUnappliedRotationDegrees,
currentPixelWidthHeightRatio);
eventDispatcher.videoSizeChanged(reportedWidth, reportedHeight,
reportedUnappliedRotationDegrees, reportedPixelWidthHeightRatio);
}
}