Use UnrecognizedFormatException for progressive media only

PiperOrigin-RevId: 377303025
This commit is contained in:
aquilescanta 2021-06-03 17:17:52 +01:00 committed by bachinger
parent 2b6581afe0
commit af4b891c99
3 changed files with 5 additions and 5 deletions

View File

@ -135,7 +135,7 @@ public class ParserException extends IOException {
this(/* message= */ null, cause, /* contentIsMalformed= */ true, C.DATA_TYPE_UNKNOWN);
}
private ParserException(
protected ParserException(
@Nullable String message,
@Nullable Throwable cause,
boolean contentIsMalformed,

View File

@ -16,6 +16,7 @@
package com.google.android.exoplayer2.source;
import android.net.Uri;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ParserException;
/** Thrown if the input format was not recognized. */
@ -29,7 +30,7 @@ public class UnrecognizedInputFormatException extends ParserException {
* @param uri The {@link Uri} from which the unrecognized data was read.
*/
public UnrecognizedInputFormatException(String message, Uri uri) {
super(message);
super(message, /* cause= */ null, /* contentIsMalformed= */ false, C.DATA_TYPE_MEDIA);
this.uri = uri;
}
}

View File

@ -30,7 +30,6 @@ import com.google.android.exoplayer2.drm.DrmInitData;
import com.google.android.exoplayer2.drm.DrmInitData.SchemeData;
import com.google.android.exoplayer2.extractor.mp4.PsshAtomUtil;
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.VariantInfo;
import com.google.android.exoplayer2.source.hls.playlist.HlsMasterPlaylist.Rendition;
@ -255,8 +254,8 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
String line;
try {
if (!checkPlaylistHeader(reader)) {
throw new UnrecognizedInputFormatException(
"Input does not start with the #EXTM3U header.", uri);
throw ParserException.createForMalformedManifest(
/* message= */ "Input does not start with the #EXTM3U header.", /* cause= */ null);
}
while ((line = reader.readLine()) != null) {
line = line.trim();