Commit af4b891c by aquilescanta Committed by bachinger

Use UnrecognizedFormatException for progressive media only

PiperOrigin-RevId: 377303025
parent 2b6581af
...@@ -135,7 +135,7 @@ public class ParserException extends IOException { ...@@ -135,7 +135,7 @@ public class ParserException extends IOException {
this(/* message= */ null, cause, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN); this(/* message= */ null, cause, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN);
} }
private ParserException( protected ParserException(
@Nullable String message, @Nullable String message,
@Nullable Throwable cause, @Nullable Throwable cause,
boolean contentIsMalformed, boolean contentIsMalformed,
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package com.google.android.exoplayer2.source; package com.google.android.exoplayer2.source;
import android.net.Uri; import android.net.Uri;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ParserException; import com.google.android.exoplayer2.ParserException;
/** Thrown if the input format was not recognized. */ /** Thrown if the input format was not recognized. */
...@@ -29,7 +30,7 @@ public class UnrecognizedInputFormatException extends ParserException { ...@@ -29,7 +30,7 @@ public class UnrecognizedInputFormatException extends ParserException {
* @param uri The {@link Uri} from which the unrecognized data was read. * @param uri The {@link Uri} from which the unrecognized data was read.
*/ */
public UnrecognizedInputFormatException(String message, Uri uri) { public UnrecognizedInputFormatException(String message, Uri uri) {
super(message); super(message, /* cause= */ null, /* contentIsMalformed= */ false, C.DATA_TYPE_MEDIA);
this.uri = uri; this.uri = uri;
} }
} }
...@@ -30,7 +30,6 @@ import com.google.android.exoplayer2.drm.DrmInitData; ...@@ -30,7 +30,6 @@ import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.drm.DrmInitData.SchemeData; import com.google.android.exoplayer2.drm.DrmInitData.SchemeData;
import com.google.android.exoplayer2.extractor.mp4.PsshAtomUtil; import com.google.android.exoplayer2.extractor.mp4.PsshAtomUtil;
import com.google.android.exoplayer2.metadata.Metadata; import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.source.UnrecognizedInputFormatException;
import com.google.android.exoplayer2.source.hls.HlsTrackMetadataEntry; import com.google.android.exoplayer2.source.hls.HlsTrackMetadataEntry;
import com.google.android.exoplayer2.source.hls.HlsTrackMetadataEntry.VariantInfo; import com.google.android.exoplayer2.source.hls.HlsTrackMetadataEntry.VariantInfo;
import com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Rendition; import com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Rendition;
...@@ -255,8 +254,8 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli ...@@ -255,8 +254,8 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
String line; String line;
try { try {
if (!checkPlaylistHeader(reader)) { if (!checkPlaylistHeader(reader)) {
throw new UnrecognizedInputFormatException( throw ParserException.createForMalformedManifest(
"Input does not start with the #EXTM3U header.", uri); /* message= */ "Input does not start with the #EXTM3U header.", /* cause= */ null);
} }
while ((line = reader.readLine()) != null) { while ((line = reader.readLine()) != null) {
line = line.trim(); line = line.trim();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment