Skip to content

Commit

Permalink
test2
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Mar 31, 2021
1 parent 574d437 commit 0749e1e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/src/main/java/org/schabi/newpipe/player/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,21 @@ public Bitmap transform(final Bitmap source) {
/ (source.getWidth() / notificationThumbnailWidth)),
true);

if (result != source) {
if (result == source) {
// create a new mutable bitmap to prevent strange crashes on some
// devices (see #4638)
final Bitmap copied = Bitmap.createScaledBitmap(
source,
(int) notificationThumbnailWidth - 1,
(int) (source.getHeight() / (source.getWidth()
/ (notificationThumbnailWidth - 1))),
true);
source.recycle();
return copied;
} else {
source.recycle();
return result;
}
return result;
}

@Override
Expand Down

0 comments on commit 0749e1e

Please sign in to comment.