Skip to content

Commit

Permalink
Improve logging by including full stack trace, and add release note
Browse files Browse the repository at this point in the history
  • Loading branch information
icbaker committed Jan 3, 2024
1 parent 820278c commit f935f59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
* Fix bug where `MediaMetadata` was only populated from Vorbis comments
with upper-case keys
([#876](https://github.com/androidx/media/issues/876)).
* Catch `OutOfMemoryError` when parsing very large ID3 frames, meaning
playback can continue without the tag info instead of playback failing
completely.
* DRM:
* Extend workaround for spurious ClearKey `https://default.url` license
URL to API 33+ (previously the workaround only applied on API 33
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ private static Id3Frame decodeFrame(
frameSize = removeUnsynchronization(id3Data, frameSize);
}

String error = "";
Id3Frame frame = null;
Throwable error = null;
try {
if (frameId0 == 'T'
&& frameId1 == 'X'
Expand Down Expand Up @@ -431,10 +431,8 @@ private static Id3Frame decodeFrame(
String id = getFrameId(majorVersion, frameId0, frameId1, frameId2, frameId3);
frame = decodeBinaryFrame(id3Data, frameSize, id);
}
} catch (Exception e) {
error = ",error=" + e.getMessage();
} catch (OutOfMemoryError e) {
error = ",error=" + e.getMessage();
} catch (OutOfMemoryError | Exception e) {
error = e;
} finally {
id3Data.setPosition(nextFramePosition);
}
Expand All @@ -444,8 +442,8 @@ private static Id3Frame decodeFrame(
"Failed to decode frame: id="
+ getFrameId(majorVersion, frameId0, frameId1, frameId2, frameId3)
+ ", frameSize="
+ frameSize
+ error);
+ frameSize,
error);
}
return frame;
}
Expand Down

0 comments on commit f935f59

Please sign in to comment.