Skip to content

Commit

Permalink
FLV: Ignore invalid SCRIPTDATA name type, rather than fail playback
Browse files Browse the repository at this point in the history
Issue: google#7675
PiperOrigin-RevId: 323371286
  • Loading branch information
ojw28 authored and zxzx74147 committed Sep 7, 2020
1 parent ef392b1 commit f0cdf8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
* FMP4: Fix `saiz` and `senc` sample count checks, resolving a "length
mismatch" `ParserException` when playing certain protected FMP4 streams
([#7592](https://github.com/google/ExoPlayer/issues/7592)).
* FLV: Ignore SCRIPTDATA segments with invalid name types, rather than failing
playback ([#7675](https://github.com/google/ExoPlayer/issues/7675)).
* IMA extension: Upgrade to IMA SDK 3.19.4, bringing in a fix for setting the
media load timeout
([#7170](https://github.com/google/ExoPlayer/issues/7170)).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.extractor.DummyTrackOutput;
import com.google.android.exoplayer2.util.ParsableByteArray;
import java.util.ArrayList;
Expand Down Expand Up @@ -65,11 +64,11 @@ protected boolean parseHeader(ParsableByteArray data) {
}

@Override
protected boolean parsePayload(ParsableByteArray data, long timeUs) throws ParserException {
protected boolean parsePayload(ParsableByteArray data, long timeUs) {
int nameType = readAmfType(data);
if (nameType != AMF_TYPE_STRING) {
// Should never happen.
throw new ParserException();
// Ignore segments with unexpected name type.
return false;
}
String name = readAmfString(data);
if (!NAME_METADATA.equals(name)) {
Expand Down

0 comments on commit f0cdf8e

Please sign in to comment.