Commit graph

252 commits

Author SHA1 Message Date
Claude
46d152dfc5
fix: guard StremioServer::start() with a running flag
start() unconditionally spawned a fresh stremio-runtime every time it
was called. Today only the GUI thread calls it, but the crash-restart
path can re-fire start() while the previous teardown is still in
progress, racing two runtimes for port 11470.

Track a `running: Arc<AtomicBool>` on the struct: swap(true) on entry
and bail with a log if the previous server thread has not yet flipped
it back to false. Reset to false right before sender.notice() so that
the GUI's crash handler can legitimately spawn the next instance.

Closes #57
2026-05-10 14:44:18 +00:00
Claude
51d75cfe6e
fix: search accumulated log buffer for server readiness line
The stdout reader matched 'EngineFS server started at' against
string_data (the bytes from the most recent read only). If server.js
flushed in such a way that the readiness line straddled two reads,
neither chunk's .lines() yielded a full match, the endpoint channel
never received, recv() timed out, and the WebUI loaded against the
fallback URL.

Search the accumulated *lines buffer instead so a line split across
reads matches once the second chunk lands. Track endpoint_sent so we
do not resend on every subsequent chunk after a match.

Also preserve trailing newlines when trimming the retained buffer to
SRV_LOG_SIZE lines so a later chunk cannot be concatenated onto the
last unterminated line and corrupt a parser. Same trim treatment for
the stderr reader for consistency.

Closes #53
2026-05-10 14:43:48 +00:00
Claude
1464d46172
fix: kill and wait stremio-runtime child after readers finish
After both stdout and stderr readers exited, the Child handle was just
dropped at the end of the match arm. On Windows std::process::Child's
Drop neither kills nor waits, so the OS process kept its kernel object
(and its bound ports) alive until either the JobObject KILL_ON_JOB_CLOSE
fired on shell exit or init adopted it.

In the crash-restart path this is worse: a fresh start() is launched
while the previous runtime is still being reaped, and both processes
race for port 11470.

Explicitly kill().ok() + wait().ok() once the readers see EOF so the
previous runtime is gone before we report 'Server terminated.' and fire
the crash notice. Errors from killing an already-exited child are
intentionally swallowed.

Closes #50
2026-05-10 14:43:28 +00:00
Claude
2294f52407
fix: guard JobObject setup with Once and check return values
CreateJobObjectA / SetInformationJobObject / AssignProcessToJobObject
were called inside the per-start thread and their return values were
ignored. Two consequences:

1. Each server crash-restart created a fresh kernel JobObject HANDLE
   that was never CloseHandle'd. The HANDLE went out of scope when the
   spawned thread exited, leaking a kernel object every crash.
2. On Win 7/8 (single-job systems) and inside parent jobs that disallow
   breakaway, AssignProcessToJobObject silently failed, so
   stremio-runtime could survive the shell's death and hold port 11470.

Hoist the setup into ensure_parent_job_object() guarded by sync::Once
so it runs exactly once per shell process, and check each return value
explicitly with a clear log message when the OS-level safety net is
degraded. The HANDLE is intentionally not closed: closing it while
KILL_ON_JOB_CLOSE is set would terminate the shell itself.

Closes #47
Closes #48
2026-05-10 14:43:06 +00:00
Claude
a9d9673f2a
fix: break server reader threads on read error
stdout.read(...).unwrap_or(!0) substituted usize::MAX on Err, then
`if on > buffer.len() { continue; }` swallowed it and looped back into
read(). On a sticky IO error (broken pipe, EBADF) the thread spun a
CPU core forever and the accumulated logs were never flushed.

Match Ok(0)/Ok(n)/Err(e) explicitly: break on EOF, break on error after
logging, and treat any other Ok(n) as bytes read. Same change for
stderr.

Closes #51
2026-05-10 12:32:20 +00:00
Vladimir Borisov
bbbe882faf
Version updated to v5.0.21
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-04-27 13:18:20 +03:00
Владимир Борисов
7f2bbb2c12
Merge pull request #38 from Stremio/feat/player-add-video-scale-property
Some checks failed
Continuous integration / test (push) Has been cancelled
Feat/Player add video scale property
2026-04-23 11:18:41 +03:00
Владимир Борисов
d8ec1c4cc1
Merge pull request #39 from Stremio/feat/media-keys-support
Feat/Player add media keys support
2026-04-23 11:17:49 +03:00
Владимир Борисов
8be5a2cfca
Merge pull request #40 from Stremio/claude/fix-player-error-handling-pMLQG
fix(Player): stop fabricating end-file on transient mpv event errors
2026-04-23 11:12:34 +03:00
Claude
e25dc1fd02
fix(Player): stop fabricating end-file on transient mpv event errors
Commit 0b882f3 synthesized an Event::EndFile(Error) whenever
event_context.wait_event returned libmpv2::Error::Raw and forwarded it
to the web layer. MPV is fully able to continue playback after such
transient errors (its demuxer cache is intact), so fabricating an
end-of-file caused long-running HTTP streams (e.g. RealDebrid) to flip
to a blocking "Loading failed" overlay mid-playback. Revert that branch
to the prior log-and-continue behavior.

Also downgrade PlayerEnded errors from critical:true to critical:false
so genuine mpv_end_file_reason::Error surfaces as a 3s toast in
stremio-web (Player.js), letting the user retry, instead of an
unrecoverable full-screen overlay.
2026-04-22 22:07:54 +00:00
Timothy Z.
285415be55 chore: lint 2026-04-22 18:23:29 +03:00
Timothy Z.
fe13fb0fa4 feat: add media keys support to player 2026-04-22 18:18:07 +03:00
Timothy Z.
342a005dc0 feat: player add video scale property 2026-04-22 15:34:21 +03:00
Владимир Борисов
aced2eadc1
Merge pull request #37 from Stremio/fix/demuxer-cache-time
Some checks failed
Continuous integration / test (push) Has been cancelled
Player: Added demuxer cache time
2026-04-14 13:21:43 +03:00
Botzy
d43c462adf fix(Player): added demuxer cache time to get buffered value 2026-04-14 12:07:31 +03:00
Vladimir Borisov
68d620564e
Version updated to v5.0.20
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-03-23 14:18:20 +02:00
Vladimir Borisov
17c1abdf9f
update server to v4.20.17
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-03-20 14:16:19 +02:00
Vladimir Borisov
f1db70f875
Version updated to v5.0.19
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-03-12 17:58:11 +02:00
Vladimir Borisov
2618909b65
Update libmpv2 2026-03-12 17:57:21 +02:00
Vladimir Borisov
ace5680343
Remove build thread arm64 2026-03-12 17:54:25 +02:00
Vladimir Borisov
0b882f3f9b
Handle Player critical errors 2026-03-12 17:28:44 +02:00
Vladimir Borisov
72f881447a
Remove sign thread 2026-03-12 17:27:44 +02:00
Vladimir Borisov
ff78623e70
Fix checkout action
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-03-10 12:13:52 +02:00
Vladimir Borisov
8a77e547bc
Update checkout action 2026-03-10 11:58:08 +02:00
Vladimir Borisov
95c718dd25
Version check 2026-03-10 10:54:23 +02:00
Vladimir Borisov
7461b2efcd
Better uploader 2026-02-05 13:48:58 +02:00
Vladimir Borisov
1bf13bd4ff
Bump version
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-02-05 13:25:43 +02:00
Vladimir Borisov
15069204be
Server IPC key
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-02-02 17:21:47 +02:00
Vladimir Borisov
07d821012d
server IPC key 2026-02-02 14:54:41 +02:00
Vladimir Borisov
f1aeb06c0f
Bump version to 5.0.16
Some checks failed
Continuous integration / test (push) Has been cancelled
2026-01-09 15:34:24 +02:00
Vladimir Borisov
29ae6ed80d
Update the server 2026-01-09 15:33:45 +02:00
Vladimir Borisov
b8a0345b0d
Arm64 installer
Some checks failed
Continuous integration / test (push) Has been cancelled
2025-12-18 12:40:50 +02:00
Vladimir Borisov
0a08fed2cb
Multi architecture descriptors
Some checks failed
Continuous integration / test (push) Has been cancelled
2025-12-05 15:44:01 +02:00
Vladimir Borisov
fd84baff33
Bump version 5.0.15
Some checks failed
Continuous integration / test (push) Has been cancelled
2025-11-27 18:12:31 +02:00
Vladimir Borisov
385259b6d5
Fix libmpv 2025-11-27 18:12:02 +02:00
Vladimir Borisov
0ad2fd7a0e
Version bump to 5.0.14
Some checks are pending
Continuous integration / test (push) Waiting to run
2025-11-27 16:57:14 +02:00
Vladimir Borisov
be55565ee4
Check for architecture specific updates
Some checks failed
Continuous integration / test (push) Has been cancelled
2025-11-27 16:35:40 +02:00
Vladimir Borisov
522a4d6a66
Update server.js to v4.20.15 2025-11-27 15:50:34 +02:00
Vladimir Borisov
7f3a1b074f
linker flags 2025-11-27 14:02:54 +02:00
Владимир Борисов
53cfa3dc21
Windows no ARM build 2025-11-12 18:02:41 +02:00
Vladimir Borisov
81fa5c902d
Bump version to v5.0.13
Some checks failed
Continuous integration / test (push) Has been cancelled
2025-08-05 17:44:06 +03:00
Vladimir Borisov
6236797e37
Downgrade mpv 2025-08-05 17:42:54 +03:00
Vladimir Borisov
5cd2b35255
Bump app version to 5.0.12 2025-08-05 13:49:55 +03:00
Vladimir Borisov
9a77a10822
Update the code dependencies script 2025-08-05 13:49:22 +03:00
Vladimir Borisov
81690ad07a
Us correct DLLs 2025-08-05 13:49:03 +03:00
Vladimir Borisov
ea39138226
Signed libmpv 2025-08-05 11:27:55 +03:00
Vladimir Borisov
17256e1bc1
Update to v5.0.11 2025-08-05 11:01:44 +03:00
Vladimir Borisov
aba65c1d69
Bundle the vcruntime_1 dll 2025-08-05 11:01:13 +03:00
Vladimir Borisov
372f1079c0
Update version to 5.0.10 2025-08-05 10:47:12 +03:00
Vladimir Borisov
c58de39e54
Add 64 bit vcruntime 2025-08-05 10:45:55 +03:00