Use MediaFormat.language in hashCode and equals.

This commit is contained in:
Oliver Woodman 2015-08-11 18:11:35 +01:00
parent 7d306ae593
commit d6152dc36a

View File

@ -171,8 +171,8 @@ public final class MediaFormat {
@Override @Override
public String toString() { public String toString() {
return "MediaFormat(" + mimeType + ", " + maxInputSize + ", " + width + ", " + height + ", " return "MediaFormat(" + mimeType + ", " + maxInputSize + ", " + width + ", " + height + ", "
+ pixelWidthHeightRatio + ", " + channelCount + ", " + sampleRate + ", " + durationUs + ", " + pixelWidthHeightRatio + ", " + channelCount + ", " + sampleRate + ", " + language + ", "
+ maxWidth + ", " + maxHeight + ")"; + durationUs + ", " + maxWidth + ", " + maxHeight + ")";
} }
@Override @Override
@ -189,6 +189,7 @@ public final class MediaFormat {
result = 31 * result + maxHeight; result = 31 * result + maxHeight;
result = 31 * result + channelCount; result = 31 * result + channelCount;
result = 31 * result + sampleRate; result = 31 * result + sampleRate;
result = 31 * result + (language == null ? 0 : language.hashCode());
for (int i = 0; i < initializationData.size(); i++) { for (int i = 0; i < initializationData.size(); i++) {
result = 31 * result + Arrays.hashCode(initializationData.get(i)); result = 31 * result + Arrays.hashCode(initializationData.get(i));
} }
@ -223,7 +224,7 @@ public final class MediaFormat {
|| pixelWidthHeightRatio != other.pixelWidthHeightRatio || pixelWidthHeightRatio != other.pixelWidthHeightRatio
|| (!ignoreMaxDimensions && (maxWidth != other.maxWidth || maxHeight != other.maxHeight)) || (!ignoreMaxDimensions && (maxWidth != other.maxWidth || maxHeight != other.maxHeight))
|| channelCount != other.channelCount || sampleRate != other.sampleRate || channelCount != other.channelCount || sampleRate != other.sampleRate
|| !Util.areEqual(mimeType, other.mimeType) || !Util.areEqual(language, other.language) || !Util.areEqual(mimeType, other.mimeType)
|| initializationData.size() != other.initializationData.size()) { || initializationData.size() != other.initializationData.size()) {
return false; return false;
} }