mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-25 04:22:30 +01:00
Recycle Bitmap in transformation
This commit is contained in:
parent
fcef783bbb
commit
314964c5f9
@ -1235,12 +1235,18 @@ public final class Player implements
|
||||
context.getResources()
|
||||
.getDimension(R.dimen.player_notification_thumbnail_width),
|
||||
source.getWidth());
|
||||
return Bitmap.createScaledBitmap(
|
||||
|
||||
final Bitmap result = Bitmap.createScaledBitmap(
|
||||
source,
|
||||
(int) notificationThumbnailWidth,
|
||||
(int) (source.getHeight()
|
||||
/ (source.getWidth() / notificationThumbnailWidth)),
|
||||
true);
|
||||
|
||||
if (result != source) {
|
||||
source.recycle();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user