Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/dtsx codec updates #9163

Closed
wants to merge 4 commits into from
Closed

Feature/dtsx codec updates #9163

wants to merge 4 commits into from

Conversation

ProtoScott
Copy link
Contributor

Updates to the ExoPlayer mp4 atom extractor/parser for DTS:X support.
Updates to the ExoPlayer MimeTypes to support DTS:X.
Updated MediaCodecInfo with correct channel adjustments for DTS codecs.

@ProtoScott
Copy link
Contributor Author

@kim-vde Do you have any comments on this PR?
I was really hoping to get it merged and available in the next release for a project I'm working on.
Many Thanks!

kim-vde added a commit that referenced this pull request Jul 23, 2021
@kim-vde kim-vde closed this Jul 23, 2021
@kim-vde kim-vde reopened this Jul 23, 2021
@kim-vde
Copy link
Contributor

kim-vde commented Jul 23, 2021

I've just merged the change in 8e29e76. Our tooling didn't work properly so the issue is not marked as so. I will close it.

@kim-vde kim-vde closed this Jul 23, 2021
@krocard
Copy link
Contributor

krocard commented Sep 9, 2021

The tooling didn't mark the PR as closed because @ProtoScott reverted the commit head on the 22 after @kim-vde merged the PR in our staging branch.
@ProtoScott Why was Updated MediaCodecInfo with correct channel adjustments for DTS codecs reverted on your PR branch? Did you intend on not merging this commit or was it a manipulation error?

@ProtoScott
Copy link
Contributor Author

The tooling didn't mark the PR as closed because @ProtoScott reverted the commit head on the 22 after @kim-vde merged the PR in our staging branch.
@ProtoScott Why was Updated MediaCodecInfo with correct channel adjustments for DTS codecs reverted on your PR branch? Did you intend on not merging this commit or was it a manipulation error?

That change was reverted based on feedback from @kim-vde. This change was intended.

@ojw28
Copy link
Contributor

ojw28 commented Sep 10, 2021

Just to clarify, we did merge the right thing here (i.e., we did not forget to include the revert). You can verify this by looking at 8e29e76.

The PR not being marked as merged does not imply that we didn't pick up a commit that we should have. In most cases it's just an (avoidable) process problem with the way we merge the internal commit.

@krocard
Copy link
Contributor

krocard commented Sep 13, 2021

Technically the revert commit was not merged. The merge commit 8e29e76 has 2 parent, one is the dev-v2 branch head before the merge (72cf9c3), the second is the 3rd commit of the PR: 83d2c39. If the revert commit (3003fc9) had been merged, it would be the parent of the merge commit. This can be confirm with:

$ git branch --contains 83d2c39a363ab76bc7415f30b47aa7aff4e55a23
* dev-v2
$ git branch --contains 3003fc91fc8c65d7caf6bfefcd8e27c301c0c1e3
error: no such commit 3003fc91fc8c65d7caf6bfefcd8e27c301c0c1e3

$ tig 8e29e76b517157decf3a5993cbc32ffc759173ca
2021-07-23 14:12 +0100 kim-vde                    M─┐ Merge pull request #9163 from ProtoScott:feature/dtsx_codec_updates
2021-07-08 11:17 +0100 Scott                      │ o Updated MediaCodecInfo with correct channel adjustments for DTS codecs
2021-07-08 11:11 +0100 Scott                      │ o Updated mimetypes to support DTSX and to correct assign dtse to DTS Express
2021-07-08 11:07 +0100 Scott                      │ o Updates to mp4 atom extractor/parser for dtsx support.

As you can see the revert commit never made it in the dev-v2 branch.

Nevertheless, the content of the revert did make it in the merge commit. If we recreate the merge commit, without any modification, and diff it with the actual merge (8e29e76):

$ git checkout 8e29e76b517157decf3a5993cbc32ffc759173ca^1
$ git merge 8e29e76b517157decf3a5993cbc32ffc759173ca^2
$ git diff HEAD 8e29e76b517157decf3a5993cbc32ffc759173ca
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -103,6 +103,9 @@
+*   Extractors:
+    *   Add support for DTS-UHD in MP4
+        ([#9163](https://github.com/google/ExoPlayer/issues/9163).
--- a/library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java
+++ b/library/common/src/main/java/com/google/android/exoplayer2/util/MimeTypes.java
-  public static final String AUDIO_DTS_X = BASE_TYPE_AUDIO + "/vnd.dts.uhd";
+  public static final String AUDIO_DTS_UHD = BASE_TYPE_AUDIO + "/vnd.dts.uhd";
@@ -385,10 +385,10 @@ public final class MimeTypes {
-    } else if (codec.startsWith("dtsx")) {
-      return MimeTypes.AUDIO_DTS_X;
     } else if (codec.startsWith("dtsh") || codec.startsWith("dtsl")) {
       return MimeTypes.AUDIO_DTS_HD;
+    } else if (codec.startsWith("dtsx")) {
+      return MimeTypes.AUDIO_DTS_UHD;
--- a/library/common/src/test/java/com/google/android/exoplayer2/util/MimeTypesTest.java
+++ b/library/common/src/test/java/com/google/android/exoplayer2/util/MimeTypesTest.java
@@ -137,9 +137,10 @@ public final class MimeTypesTest {
-    assertThat(MimeTypes.getMediaMimeType("dtse")).isEqualTo(MimeTypes.AUDIO_DTS);
+    assertThat(MimeTypes.getMediaMimeType("dtse")).isEqualTo(MimeTypes.AUDIO_DTS_EXPRESS);
     assertThat(MimeTypes.getMediaMimeType("dtsh")).isEqualTo(MimeTypes.AUDIO_DTS_HD);
     assertThat(MimeTypes.getMediaMimeType("dtsl")).isEqualTo(MimeTypes.AUDIO_DTS_HD);
+    assertThat(MimeTypes.getMediaMimeType("dtsx")).isEqualTo(MimeTypes.AUDIO_DTS_UHD);
--- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
+++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecInfo.java
@@ -624,10 +624,6 @@ public final class MediaCodecInfo {
-        || MimeTypes.AUDIO_DTS.equals(mimeType)
-        || MimeTypes.AUDIO_DTS_HD.equals(mimeType)
-        || MimeTypes.AUDIO_DTS_EXPRESS.equals(mimeType)
-        || MimeTypes.AUDIO_DTS_X.equals(mimeType)
--- a/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java
+++ b/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/mp4/AtomParsers.java
@@ -1373,7 +1373,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
-      mimeType = MimeTypes.AUDIO_DTS_X;
+      mimeType = MimeTypes.AUDIO_DTS_UHD;

So the revert commit was never merged, but @kim-vde made the same change (and others) after importing the PR.
So Github is correct in saying that the PR was not merged (at least not fully), but @ojw28 is also correct saying nothing was missed here.

The PR not being marked as merged does not imply that we didn't pick up a commit that we should have.

I don't believe this to be correct. Anytime the PR is not marked as merged, it means the commits merged were not the exact ones from the PR. Though as here, we might have done the same manual change in the merge commit.

In most cases it's just an (avoidable) process problem with the way we merge the internal commit.

I think we should double check any time this occurs, which should be pretty rare.

@kim-vde
Copy link
Contributor

kim-vde commented Sep 13, 2021

It makes sense to me that the PR has not been automatically marked as merged, because, as @krocard noted, the last commit has not been technically merged.

The question is more, what's the best way to deal with this situation? Should we for example update the commit ID in the change description so that the PR is automatically marked as merged when we push the change?

@krocard
Copy link
Contributor

krocard commented Sep 13, 2021

I think the main thing we want to avoid is that the PR author finds a bug, updates the PR, we miss the fix and erroneously manually close the PR as merged.

Let's discuss about the best way to avoid this situation in our next team meeting.

@google google locked and limited conversation to collaborators Sep 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants