Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d73366e3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I4a53a0cc,I053d0686

* changes:
  Add FlacExtractor to MediaParser
  Fix MediaParser sniffing
parents b65453fd f1076aa8
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.media;

import android.annotation.CheckResult;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.net.Uri;
@@ -32,6 +33,7 @@ import com.google.android.exoplayer2.extractor.PositionHolder;
import com.google.android.exoplayer2.extractor.SeekMap.SeekPoints;
import com.google.android.exoplayer2.extractor.TrackOutput;
import com.google.android.exoplayer2.extractor.amr.AmrExtractor;
import com.google.android.exoplayer2.extractor.flac.FlacExtractor;
import com.google.android.exoplayer2.extractor.flv.FlvExtractor;
import com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor;
import com.google.android.exoplayer2.extractor.mp3.Mp3Extractor;
@@ -382,6 +384,7 @@ public final class MediaParser {
         * parse the input.
         */
        @NonNull
        @CheckResult
        private static UnrecognizedInputFormatException createForExtractors(
                @NonNull String... extractorNames) {
            StringBuilder builder = new StringBuilder();
@@ -536,7 +539,7 @@ public final class MediaParser {
                }
            }
            if (mExtractor == null) {
                UnrecognizedInputFormatException.createForExtractors(mExtractorNamesPool);
                throw UnrecognizedInputFormatException.createForExtractors(mExtractorNamesPool);
            }
            return true;
        }
@@ -912,6 +915,7 @@ public final class MediaParser {
        extractorFactoriesByName.put("exo.Ac4Extractor", Ac4Extractor::new);
        extractorFactoriesByName.put("exo.AdtsExtractor", AdtsExtractor::new);
        extractorFactoriesByName.put("exo.AmrExtractor", AmrExtractor::new);
        extractorFactoriesByName.put("exo.FlacExtractor", FlacExtractor::new);
        extractorFactoriesByName.put("exo.FlvExtractor", FlvExtractor::new);
        extractorFactoriesByName.put("exo.FragmentedMp4Extractor", FragmentedMp4Extractor::new);
        extractorFactoriesByName.put("exo.MatroskaExtractor", MatroskaExtractor::new);