introduced 'original' as video quality and do not ignorer error

This commit is contained in:
Daniel Gultsch 2019-01-02 10:03:33 +01:00
parent 6ac1c00d00
commit cfab0dbe1b
3 changed files with 10 additions and 2 deletions

View File

@ -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);
}
}
}

View File

@ -116,10 +116,12 @@
<string-array name="video_compression_values">
<item>360</item>
<item>720</item>
<item>uncompressed</item>
</string-array>
<string-array name="video_compression_entries">
<item>@string/video_360p</item>
<item>@string/video_720p</item>
<item>@string/video_original</item>
</string-array>
</resources>

View File

@ -805,4 +805,5 @@
<string name="no_market_app_installed">No market app installed.</string>
<string name="group_chat_will_make_your_jabber_id_public">This group chat will make your Jabber ID public</string>
<string name="ebook">e-book</string>
<string name="video_original">Original (uncompressed)</string>
</resources>