From cfab0dbe1b7dcb7b979058ca29d2352ea940ed74 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 2 Jan 2019 10:03:33 +0100 Subject: [PATCH] introduced 'original' as video quality and do not ignorer error --- .../services/AttachFileToConversationRunnable.java | 9 +++++++-- src/main/res/values/arrays.xml | 2 ++ src/main/res/values/strings.xml | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/AttachFileToConversationRunnable.java b/src/main/java/eu/siacs/conversations/services/AttachFileToConversationRunnable.java index 330e4cb8a..21ab5fb00 100644 --- a/src/main/java/eu/siacs/conversations/services/AttachFileToConversationRunnable.java +++ b/src/main/java/eu/siacs/conversations/services/AttachFileToConversationRunnable.java @@ -50,7 +50,7 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod final String mimeType = MimeUtils.guessMimeTypeFromUriAndMime(mXmppConnectionService, uri, type); final int autoAcceptFileSize = mXmppConnectionService.getResources().getInteger(R.integer.auto_accept_filesize); this.originalFileSize = FileBackend.getFileSize(mXmppConnectionService,uri); - this.isVideoMessage = (mimeType != null && mimeType.startsWith("video/")) && originalFileSize > autoAcceptFileSize; + this.isVideoMessage = (mimeType != null && mimeType.startsWith("video/")) && originalFileSize > autoAcceptFileSize && !"uncompressed".equals(getVideoCompression()); } boolean isVideoMessage() { @@ -108,7 +108,12 @@ public class AttachFileToConversationRunnable implements Runnable, MediaTranscod } catch (InterruptedException e) { throw new AssertionError(e); } catch (ExecutionException e) { - Log.d(Config.LOGTAG,"ignoring execution exception. Should get handled by onTranscodeFiled() instead",e); + if (e.getCause() instanceof Error) { + mXmppConnectionService.stopForcingForegroundNotification(); + processAsFile(); + } else { + Log.d(Config.LOGTAG, "ignoring execution exception. Should get handled by onTranscodeFiled() instead", e); + } } } diff --git a/src/main/res/values/arrays.xml b/src/main/res/values/arrays.xml index d5285e08a..54e122dad 100644 --- a/src/main/res/values/arrays.xml +++ b/src/main/res/values/arrays.xml @@ -116,10 +116,12 @@ 360 720 + uncompressed @string/video_360p @string/video_720p + @string/video_original diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index f0fbe841e..306e29af5 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -805,4 +805,5 @@ No market app installed. This group chat will make your Jabber ID public e-book + Original (uncompressed)