From 5972d1d69f71e097c8f51bf60c8f3845965acf9a Mon Sep 17 00:00:00 2001 From: DrKLO Date: Mon, 27 Aug 2018 21:45:56 +0300 Subject: [PATCH] Bug fixes --- .../main/java/org/telegram/messenger/MediaController.java | 4 ++-- .../src/main/java/org/telegram/ui/BlockedUsersActivity.java | 6 +++--- .../java/org/telegram/ui/Components/InstantCameraView.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java index 74f91605e..1ffd4050a 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MediaController.java @@ -3891,12 +3891,12 @@ public class MediaController implements AudioManager.OnAudioFocusChangeListener, outputFormat.setInteger(MediaFormat.KEY_BIT_RATE, bitrate > 0 ? bitrate : 921600); outputFormat.setInteger(MediaFormat.KEY_FRAME_RATE, framerate != 0 ? framerate : 25); outputFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 10); - if (Build.VERSION.SDK_INT >= 21) { + /*if (Build.VERSION.SDK_INT >= 21) { outputFormat.setInteger(MediaFormat.KEY_PROFILE, MediaCodecInfo.CodecProfileLevel.AVCProfileHigh); if (Build.VERSION.SDK_INT >= 23) { outputFormat.setInteger(MediaFormat.KEY_LEVEL, MediaCodecInfo.CodecProfileLevel.AVCLevel5); } - } + }*/ if (Build.VERSION.SDK_INT < 18) { outputFormat.setInteger("stride", resultWidth + 32); outputFormat.setInteger("slice-height", resultHeight); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java index d133e333c..e74fddb02 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/BlockedUsersActivity.java @@ -105,7 +105,7 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe return; } Bundle args = new Bundle(); - args.putInt("user_id", MessagesController.getInstance(currentAccount).blockedUsers.get(position)); + args.putInt("user_id", MessagesController.getInstance(currentAccount).blockedUsers.keyAt(position)); presentFragment(new ProfileActivity(args)); }); @@ -113,7 +113,7 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe if (position >= MessagesController.getInstance(currentAccount).blockedUsers.size() || getParentActivity() == null) { return true; } - selectedUserId = MessagesController.getInstance(currentAccount).blockedUsers.get(position); + selectedUserId = MessagesController.getInstance(currentAccount).blockedUsers.keyAt(position); AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); CharSequence[] items = new CharSequence[]{LocaleController.getString("Unblock", R.string.Unblock)}; @@ -219,7 +219,7 @@ public class BlockedUsersActivity extends BaseFragment implements NotificationCe @Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder.getItemViewType() == 0) { - TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(MessagesController.getInstance(currentAccount).blockedUsers.get(position)); + TLRPC.User user = MessagesController.getInstance(currentAccount).getUser(MessagesController.getInstance(currentAccount).blockedUsers.keyAt(position)); if (user != null) { String number; if (user.bot) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView.java index 236f428e0..eb80ba813 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/InstantCameraView.java @@ -1941,12 +1941,12 @@ public class InstantCameraView extends FrameLayout implements NotificationCenter format.setInteger(MediaFormat.KEY_BIT_RATE, videoBitrate); format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE); format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, IFRAME_INTERVAL); - if (Build.VERSION.SDK_INT >= 21) { + /*if (Build.VERSION.SDK_INT >= 21) { format.setInteger(MediaFormat.KEY_PROFILE, MediaCodecInfo.CodecProfileLevel.AVCProfileHigh); if (Build.VERSION.SDK_INT >= 23) { format.setInteger(MediaFormat.KEY_LEVEL, MediaCodecInfo.CodecProfileLevel.AVCLevel5); } - } + }*/ videoEncoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); surface = videoEncoder.createInputSurface();