Skip to content

Commit 9874a7c

Browse files
committed
Player: drc track selection fix
1 parent 7a18206 commit 9874a7c

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

common/src/main/java/com/liskovsoft/smartyoutubetv2/common/exoplayer/selector/ExoFormatItem.java

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class ExoFormatItem implements FormatItem {
3636
private String mLanguage;
3737
private String mFormatId;
3838
private boolean mIsPreset;
39+
private boolean mIsDrc;
3940

4041
public static List<FormatItem> from(Set<MediaTrack> mediaTracks) {
4142
if (mediaTracks == null) {
@@ -91,6 +92,7 @@ public static ExoFormatItem from(Format format) {
9192
if (format.id != null) {
9293
formatItem.mId = format.id.hashCode();
9394
formatItem.mFormatId = format.id;
95+
formatItem.mIsDrc = format.isDrc;
9496
}
9597
} else {
9698
formatItem.mIsDefault = true; // fake auto track
@@ -148,16 +150,18 @@ public boolean equals(@Nullable Object obj) {
148150
case TYPE_AUDIO:
149151
// NOTE: Don't compare subs by formatId (it's non-constant)
150152
if (mFormatId != null && formatItem.mFormatId != null) {
151-
return mType == formatItem.mType &&
152-
Helpers.equals(mFormatId, formatItem.mFormatId); // instead of compare by bitrate
153+
return mType == formatItem.mType
154+
&& mIsDrc == formatItem.mIsDrc
155+
&& Helpers.equals(mFormatId, formatItem.mFormatId); // instead of compare by bitrate
153156
}
154-
return mIsPreset == formatItem.mIsPreset &&
155-
mType == formatItem.mType &&
156-
mFrameRate == formatItem.mFrameRate &&
157-
mWidth == formatItem.mWidth &&
158-
mHeight == formatItem.mHeight &&
159-
Helpers.equals(mCodecs, formatItem.mCodecs) &&
160-
Helpers.contains(SubtitleTrack.trim(mLanguage), SubtitleTrack.trim(formatItem.mLanguage));
157+
return mIsPreset == formatItem.mIsPreset
158+
&& mType == formatItem.mType
159+
&& mIsDrc == formatItem.mIsDrc
160+
&& mFrameRate == formatItem.mFrameRate
161+
&& mWidth == formatItem.mWidth
162+
&& mHeight == formatItem.mHeight
163+
&& Helpers.equals(mCodecs, formatItem.mCodecs)
164+
&& Helpers.contains(SubtitleTrack.trim(mLanguage), SubtitleTrack.trim(formatItem.mLanguage));
161165
case TYPE_SUBTITLE:
162166
return mType == formatItem.mType &&
163167
Helpers.contains(SubtitleTrack.trim(mLanguage), SubtitleTrack.trim(formatItem.mLanguage));

smarttubetv/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ android {
5757
applicationId "app.smarttube"
5858
minSdkVersion project.properties.minSdkVersion
5959
targetSdkVersion project.properties.targetSdkVersion
60-
versionCode 2320
61-
versionName "31.30"
60+
versionCode 2321
61+
versionName "31.31"
6262
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
6363
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
6464

0 commit comments

Comments
 (0)