Merge branch 'sc' into unifiedpush

Change-Id: I90a603da765b718aae33b63fab92762316192038
This commit is contained in:
SpiritCroc 2021-08-20 09:47:10 +02:00
commit d290ddae95
3 changed files with 21 additions and 9 deletions

View File

@ -30,13 +30,15 @@ pushd "$mydir" > /dev/null
do_translation_pull=0
if git remote get-url weblate > /dev/null; then
echo "Pulling translations..."
translation commit && do_translation_pull=1 || echo "translation tool not found, skipping forced commit"
git fetch weblate
git merge weblate/sc --no-edit
else
echo "WARN: remote weblate not found, not updating translations"
if [ "$release_type" = "normal" ] && [ "$preview" != 1 ]; then
if git remote get-url weblate > /dev/null; then
echo "Pulling translations..."
translation commit && do_translation_pull=1 || echo "translation tool not found, skipping forced commit"
git fetch weblate
git merge weblate/sc --no-edit
else
echo "WARN: remote weblate not found, not updating translations"
fi
fi
last_tag=`downstream_latest_tag`

View File

@ -58,6 +58,7 @@ import org.matrix.android.sdk.internal.di.UserId
import org.matrix.android.sdk.internal.session.content.ThumbnailExtractor
import org.matrix.android.sdk.internal.session.permalinks.PermalinkFactory
import org.matrix.android.sdk.internal.session.room.send.pills.TextPillsUtils
import java.lang.RuntimeException
import javax.inject.Inject
/**
@ -256,7 +257,11 @@ internal class LocalEchoEventFactory @Inject constructor(
private fun createVideoEvent(roomId: String, attachment: ContentAttachmentData): Event {
val mediaDataRetriever = MediaMetadataRetriever()
mediaDataRetriever.setDataSource(context, attachment.queryUri)
try {
mediaDataRetriever.setDataSource(context, attachment.queryUri)
} catch (e: RuntimeException) {
e.printStackTrace()
}
// Use frame to calculate height and width as we are sure to get the right ones
val firstFrame: Bitmap? = mediaDataRetriever.frameAtTime

View File

@ -23,6 +23,7 @@ import android.provider.MediaStore
import im.vector.lib.multipicker.entity.MultiPickerAudioType
import im.vector.lib.multipicker.entity.MultiPickerImageType
import im.vector.lib.multipicker.entity.MultiPickerVideoType
import java.lang.RuntimeException
internal fun Uri.toMultiPickerImageType(context: Context): MultiPickerImageType? {
val projection = arrayOf(
@ -88,7 +89,11 @@ internal fun Uri.toMultiPickerVideoType(context: Context): MultiPickerVideoType?
context.contentResolver.openFileDescriptor(this, "r")?.use { pfd ->
val mediaMetadataRetriever = MediaMetadataRetriever()
mediaMetadataRetriever.setDataSource(pfd.fileDescriptor)
try {
mediaMetadataRetriever.setDataSource(pfd.fileDescriptor)
} catch (e: RuntimeException) {
e.printStackTrace()
}
duration = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)?.toLong() ?: 0L
width = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)?.toInt() ?: 0
height = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)?.toInt() ?: 0