Skip to content

Commit 37ccf13

Browse files
committed
Merge branch 'dev' into release
2 parents a7470a3 + cee5f32 commit 37ccf13

File tree

16 files changed

+133
-27
lines changed

16 files changed

+133
-27
lines changed

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
cmake_minimum_required (VERSION 3.9)
1919

2020
project (Lagrange
21-
VERSION 1.17.4
21+
VERSION 1.17.5
2222
DESCRIPTION "A Beautiful Gemini Client"
2323
LANGUAGES C
2424
)
2525
set (COPYRIGHT_YEAR 2023)
2626
if (IOS)
2727
set (PROJECT_VERSION 1.17)
28-
set (IOS_BUNDLE_VERSION 4)
29-
set (IOS_BUILD_DATE "2023-11-04")
28+
set (IOS_BUNDLE_VERSION 6)
29+
set (IOS_BUILD_DATE "2023-12-04")
3030
endif ()
3131
if (ANDROID)
3232
set (PROJECT_VERSION 1.17)
33-
set (ANDROID_BUILD_VERSION b24) # remember to update Gradle, AndroidManifest.xml
34-
set (ANDROID_BUILD_DATE "2023-11-04")
33+
set (ANDROID_BUILD_VERSION b25) # remember to update Gradle, AndroidManifest.xml
34+
set (ANDROID_BUILD_DATE "2023-12-04")
3535
endif ()
3636

3737
# Load modules from the source tree

lib/the_Foundation

Submodule the_Foundation updated from a6a8f58 to a963029

po/eo.po

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ msgstr ""
33
"Project-Id-Version: PACKAGE VERSION\n"
44
"Report-Msgid-Bugs-To: [email protected]\n"
55
"POT-Creation-Date: 2023-01-19 04:46+0000\n"
6-
"PO-Revision-Date: 2023-03-30 18:15+0000\n"
6+
"PO-Revision-Date: 2023-11-28 17:14+0000\n"
77
"Last-Translator: Nikolay Korotkiy <[email protected]>\n"
88
"Language-Team: Esperanto <http://weblate.skyjake.fi/projects/lagrange/ui/eo/>"
99
"\n"
@@ -841,7 +841,7 @@ msgid "heading.upload.id"
841841
msgstr "Rajtigo"
842842

843843
msgid "dlg.upload.id.default"
844-
msgstr "Defaŭlto"
844+
msgstr "Defaŭlta identeco"
845845

846846
# used on mobile
847847
msgid "dlg.upload.file"
@@ -1316,3 +1316,43 @@ msgstr "Turka"
13161316
# A language choice in the Translation dialog.
13171317
msgid "lang.uk"
13181318
msgstr "Ukraina"
1319+
1320+
msgid "menu.snip.prefs"
1321+
msgstr "Agordi…"
1322+
1323+
msgid "menu.snip.delete"
1324+
msgstr "Forigi"
1325+
1326+
msgid "snip.name"
1327+
msgstr "Nomo:"
1328+
1329+
msgid "heading.snip.new"
1330+
msgstr "Nova fragmento"
1331+
1332+
msgid "error.ansi"
1333+
msgstr "Terminalimitilo"
1334+
1335+
# Action label
1336+
msgid "fontpack.meta.viewfile"
1337+
msgstr "Montri dosieron"
1338+
1339+
msgid "fontpack.export"
1340+
msgstr "Montri la ŝablonon fontpack.ini"
1341+
1342+
msgid "sniped.new"
1343+
msgstr "Nova fragmento"
1344+
1345+
msgid "snip.accept"
1346+
msgstr "Konservi fragmenton"
1347+
1348+
msgid "snip.content"
1349+
msgstr "Enhavo:"
1350+
1351+
msgid "heading.snip.edit"
1352+
msgstr "Redakti fragmenton"
1353+
1354+
msgid "menu.snip.clipboard"
1355+
msgstr "Kopii al tondujo"
1356+
1357+
msgid "menu.snip.edit"
1358+
msgstr "Redakti…"

res/about/android-version.gmi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
```
77
# Release notes
88

9+
## 1.17 (Beta 25)
10+
* Fixed a few small memory leaks.
11+
* Gopher: Detect audio media type from file extension with the `s` item type (it's not always WAV).
12+
* Content that uses `charset=utf-8` is checked for validity. If the encoding is invalid, the content is instead decoded as CP437 (if it has ANSI escapes; possibly it's ASCII art) or just Latin-1.
13+
* Modified rule for when 'text/plain' is assumed to actually be 'text/gemini' based on the file extension.
14+
* Updated dependencies to newer versions (OpenSSL, GNU FriBidi, libiconv, libunistring).
15+
916
## 1.17 (Beta 24)
1017
* Tabs opened in background are immediately added to the URL history.
1118
* Fixed initial scope of a created identity when using the default selection.

res/about/ios-version.gmi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
```
77
# Release notes
88

9+
## 1.17 (6)
10+
* Fixed a few small memory leaks.
11+
* Fixed unnecessary copying of data while waiting for an audio buffer to become playable. This potentially caused the operating system to terminate the app due to excessive memory use.
12+
* Gopher: Detect audio media type from file extension with the `s` item type (it's not always WAV).
13+
* Content that uses `charset=utf-8` is checked for validity. If the encoding is invalid, the content is instead decoded as CP437 (if it has ANSI escapes; possibly it's ASCII art) or just Latin-1.
14+
* Modified rule for when 'text/plain' is assumed to actually be 'text/gemini' based on the file extension.
15+
* Updated UI translations.
16+
917
## 1.17 (4)
1018
* Tabs opened in background are immediately added to the URL history.
1119
* Fixed initial scope of a created identity when using the default selection.

res/about/version.gmi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
```
77
# Release notes
88

9+
## 1.17.5
10+
* Fixed a few small memory leaks.
11+
* Fixed unnecessary copying of data while waiting for an audio buffer to become playable.
12+
* Gopher: Detect audio media type from file extension with the `s` item type (it's not always WAV).
13+
* Content that uses `charset=utf-8` is checked for validity. If the encoding is invalid, the content is instead decoded as CP437 (if it has ANSI escapes; possibly it's ASCII art) or just Latin-1.
14+
* Remove ANSI escapes from window titles.
15+
* Modified rule for when 'text/plain' is assumed to actually be 'text/gemini' based on the file extension.
16+
917
## 1.17.4
1018
* Removed automatic horizontal scrolling of wide preformatted blocks. Instead, hold down the Shift key to scroll horizontally with the mouse wheel.
1119
* Fixed an event processing issue where some events were not handled as expected, for instance when opening a link into split view the opened link was not highlighted.

res/lang/eo.bin

35 Bytes
Binary file not shown.

src/audio/player.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,12 +475,11 @@ static iRangecc mediaType_(const iString *str) {
475475
return part;
476476
}
477477

478-
static iContentSpec contentSpec_Player_(const iPlayer *d) {
478+
static iContentSpec detectContentSpec_Player_(const iPlayer *d) {
479479
iContentSpec content;
480480
iZap(content);
481481
const size_t dataSize = size_InputBuf(d->data);
482-
iBuffer *buf = iClob(new_Buffer());
483-
open_Buffer(buf, &d->data->data);
482+
iBuffer *buf = NULL;
484483
const iRangecc mediaType = mediaType_(&d->mime);
485484
if (equal_Rangecc(mediaType, "audio/wave") || equal_Rangecc(mediaType, "audio/wav") ||
486485
equal_Rangecc(mediaType, "audio/x-wav") || equal_Rangecc(mediaType, "audio/x-pn-wav")) {
@@ -499,6 +498,12 @@ static iContentSpec contentSpec_Player_(const iPlayer *d) {
499498
/* TODO: Could try decoders to see if one works? */
500499
content.type = none_DecoderType;
501500
}
501+
if (content.type != none_DecoderType) {
502+
buf = iClob(new_Buffer());
503+
/* This holds a reference to the data block. The decoder runs in a background
504+
thread so it needs its own copy of the data. */
505+
open_Buffer(buf, &d->data->data);
506+
}
502507
if (content.type == wav_DecoderType && dataSize >= 44) {
503508
/* Read the RIFF/WAVE header. */
504509
iStream *is = stream_Buffer(buf);
@@ -713,6 +718,8 @@ void updateSourceData_Player(iPlayer *d, const iString *mimeType, const iBlock *
713718
break;
714719
}
715720
/* The old parts cannot have changed. */
721+
/* NOTE: The decoder will hold a reference to the data block, which means
722+
appending here will cause a copy-on-write detach to occur. */
716723
appendData_Block(&input->data, constBegin_Block(data) + oldSize, newSize - oldSize);
717724
break;
718725
}
@@ -769,7 +776,7 @@ iBool start_Player(iPlayer *d) {
769776
return iTrue;
770777
}
771778
#endif
772-
iContentSpec content = contentSpec_Player_(d);
779+
iContentSpec content = detectContentSpec_Player_(d);
773780
if (!content.output.freq) {
774781
return iFalse;
775782
}

src/gopher.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ void open_Gopher(iGopher *d, const iString *url) {
235235
return;
236236
}
237237
/* MIME type determined by the item type. */
238+
const iString *reqPath =
239+
collect_String(urlDecodeExclude_String(collectNewRange_String(parts.path), "\t"));
238240
switch (d->type) {
239241
case '0':
240242
setCStr_String(d->meta, "text/plain");
@@ -261,17 +263,22 @@ void open_Gopher(iGopher *d, const iString *url) {
261263
case 'I':
262264
setCStr_String(d->meta, "image/generic");
263265
break;
264-
case 's':
265-
setCStr_String(d->meta, "audio/wave");
266+
case 's': {
267+
const char *detected = mediaTypeFromFileExtension_String(reqPath);
268+
if (startsWith_CStr(detected, "audio/")) {
269+
setCStr_String(d->meta, detected); /* could be .mp3, for example */
270+
}
271+
else {
272+
setCStr_String(d->meta, "audio/wave");
273+
}
266274
break;
275+
}
267276
default:
268277
setCStr_String(d->meta, "application/octet-stream");
269278
break;
270279
}
271280
d->isPre = iFalse;
272281
open_Socket(d->socket);
273-
const iString *reqPath =
274-
collect_String(urlDecodeExclude_String(collectNewRange_String(parts.path), "\t"));
275282
writeData_Socket(d->socket, cstr_String(reqPath), size_String(reqPath));
276283
if (!isEmpty_Range(&parts.query)) {
277284
iAssert(*parts.query.start == '?');

src/media.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,9 @@ iBool setData_Media(iMedia *d, iGmLinkId linkId, const iString *mime, const iBlo
469469
}
470470
pushBack_PtrArray(&d->items[audio_MediaType], audio);
471471
/* Start playing right away. */
472-
start_Player(audio->player);
473-
postCommandf_App("media.player.started player:%p", audio->player);
472+
if (start_Player(audio->player)) {
473+
postCommandf_App("media.player.started player:%p", audio->player);
474+
}
474475
isNew = iTrue;
475476
#endif /* LAGRANGE_ENABLE_AUDIO */
476477
}

0 commit comments

Comments
 (0)