Repository navigation
Conversation
…s per app - The media player factory and the play policy are the app's: register_player_factory / have_player_factory / make_player / set_play_policy / play_policy / may_play_here and register_browser_player take the app, as does cvcMedia's register_ariadne_player. ari and arigl set up media for each app they make (setup_media) instead of once for the process. - The stream registry is the app's slot. It was a process-wide map keyed by app* that was never freed, so a new app at a reused address got the dead app's tokens and channel pointers. - Runtime::app() returns the app a runtime's document runs on. Allowlist -7 lines (cvc 290 -> 283). Tests: ariadne_media_test's FakeFactory registers on its test's app (made first); new APlayerFactoryIsItsAppsOwn, and ThePolicyAndTheTimeLine checks another app's policy; stream_test's AnAppsRegistryGoesWithIt; cvcmedia_player checks another app has no player; multi_app_integration_test's workload adds media and streams (every app opens a stream of the same name).
This was referenced Nov 12, 2026
Closed
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No singletons, Ariadne part 2b: the media player factory, play policy and stream registry are each app's own. Stacked on #1161 (then #1155, #1152). Breaking (4.0).
What moved onto the app
Media players. These now take the app:
register_player_factory(app, factory),have_player_factory(app)andmake_player(app, src);register_browser_player(app), and cvcMedia'sregister_ariadne_player(app).One app's player no longer plays another app's videos.
The play policy.
set_play_policy(app, policy),play_policy(app)andmay_play_here(app). Each app starts at Auto. ari and arigl apply--media-playand the player to each app they make (setup_media), not once for the process.The stream registry (
stream_registry::for_app(app)) is the app's slot. It was a process-wide map keyed byapp*that was never freed, so a later app at a reused address got the dead app's tokens and channel pointers.Runtime::app()returns the app a runtime's document runs on.gather_host_infouses it.Allowlist: -7 lines (cvc 290 -> 283)
media_player.cpp'sfactory_cell,policy_cell,registry_mutexand the guard, andstream_registry.cpp'sregistries,registries_mutexand the guard.Tests
ariadne_media_test:FakeFactoryregisters on its test's app, made first.APlayerFactoryIsItsAppsOwn: two apps' factories make only their own players, and removing one leaves the other.ThePolicyAndTheTimeLinechecks that another app's policy stays at Auto.stream_test: newAnAppsRegistryGoesWithIt. Apps made one after another, which may land at the same address, start with no tokens.cvcmedia_player: another app has no player.multi_app_integration_test: the workload adds media and streams. Even apps play always and odd ones never, and only app 0 has a player. Every app opens a stream namedshared: with the old process-wide registry, only one app's open would have succeeded.Locally (Windows, MSVC 2022): the whole tree builds, and these pass:
multi_app_integration_test2,ariadne_registries_test10,ariadne_media_test56,stream_test36;ariadne_runtime_test262,ariadne_loader_test228,ariadne_host_test46;CI
The full run is the push to
ci/full/no-singletons-ariadne-3: https://github.com/transfix/libcvc/actions/runs/43158749915.Update: 57460d6 fixes arisrvx (a server host now registers its Python engine on its app before it reads its server document). Full run: https://github.com/transfix/libcvc/actions/runs/43172073735.