summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-10-22 18:11:37 -0400
committerAndrew Opalach <andrew@akon.city> 2024-10-22 18:11:37 -0400
commit626f299dd3512d44df4bcf95fc7a21b9417c06b0 (patch)
treecff4be789f6125a82a362fbf29c8c1cfa0cc4160
parent60b4ebfbf3be78dba9dc7c65ab2bdaa0b218c0c2 (diff)
downloadcamu-626f299dd3512d44df4bcf95fc7a21b9417c06b0.tar.gz
camu-626f299dd3512d44df4bcf95fc7a21b9417c06b0.tar.bz2
camu-626f299dd3512d44df4bcf95fc7a21b9417c06b0.zip
Various fixes, doc cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
-rw-r--r--.gitignore2
-rw-r--r--doc/database.txt45
-rw-r--r--doc/design.dia224
-rw-r--r--doc/design.txt15
-rw-r--r--doc/design_diagram.svg43
-rw-r--r--doc/network_independent_audio_pause.krabin1129580 -> 1332660 bytes
-rw-r--r--doc/network_independent_audio_pause.pngbin213662 -> 148138 bytes
-rw-r--r--doc/references/pal_vs_ntsc_aspect_ratio.png (renamed from doc/pal_vs_ntsc_aspect_ratio.png)bin72101 -> 72101 bytes
-rw-r--r--doc/references/references.txt (renamed from doc/references.txt)2
-rw-r--r--doc/style.css4
-rw-r--r--flake.lock6
-rw-r--r--flake.nix2
-rw-r--r--meson.build2
-rw-r--r--src/buffer/clock.c1
-rw-r--r--src/buffer/video.c5
-rw-r--r--src/cache/meson.build19
-rw-r--r--src/codec/ffmpeg/decoder.c2
-rw-r--r--src/liana/client.c22
-rw-r--r--src/liana/client.h3
-rw-r--r--src/liana/handler.h4
-rw-r--r--src/liana/handlers/cdio_server.c1
-rw-r--r--src/liana/list.c4
-rw-r--r--src/liana/list.h21
-rw-r--r--src/liana/meson.build13
-rw-r--r--src/liana/vcr.c6
-rw-r--r--src/libsink/common.h2
-rw-r--r--src/libsink/sink.c26
-rw-r--r--src/libsink/sink.h1
-rw-r--r--src/server/local_compat.c10
-rw-r--r--src/sink/desktop.c1
30 files changed, 264 insertions, 222 deletions
diff --git a/.gitignore b/.gitignore
index 025cabc..443f273 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@
build*/
compile_commands.json
data/
-doc/**.html
+doc/**/*.html
env/bin/
old*/
src/portal/cpy/portal.c
diff --git a/doc/database.txt b/doc/database.txt
deleted file mode 100644
index 0d2afa2..0000000
--- a/doc/database.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-= CAMU Database (Archive)
-
-Types of Media for Consideration
---------------------------------
-- Music
- - Singles
- - Albums
- - Music Videos
- - Playlists (Single/Split file(s))
- - Video Game OST (ripped)
- - CD
-
-- Video
- - Movies/TV Shows
- - Youtube Channels/Videos
- - DVD/Blu-ray
-
-- Art
- - Artists
- - Twitter/Pixiv Profiles
-
-- Games
- - Steam Games
- - Roms
- - Achievements
- - Time Tracking
-
-Database
---------
-* Tied to a single directory on the filesystem
-* index.json
-* Easily referenced external files.
-** external:<BLAKE3 checksum>
-
-Database-specific Types
------------------------
-Collection
-~~~~~~~~~~
-A defined set of resources that may be stored either too loose or too bundled than desired. The exact parameters that qualify a set of resources to become a collection is up to the database owner. A general rule of thumb should be that the relationship of the resources in a collection should be externally defined and commonly agreed upon. You may also want to consider if that relationship is "official" or legally defined, whatever that would mean for your case.
-Examples
-^^^^^^^^
-* A music album where each file is a track.
-* An art book part of a larger zip archive with multiple other resources/collections.
-
-// vim: set syntax=asciidoc:
diff --git a/doc/design.dia b/doc/design.dia
index cd3c41b..e78aeca 100644
--- a/doc/design.dia
+++ b/doc/design.dia
@@ -94,6 +94,8 @@
<dia:layer name="Background" visible="true" connectable="true"/>
<dia:layer name="Background" visible="true" connectable="true"/>
<dia:layer name="Background" visible="true" connectable="true"/>
+ <dia:layer name="Background" visible="true" connectable="true"/>
+ <dia:layer name="Background" visible="true" connectable="true"/>
<dia:layer name="Background" visible="true" connectable="true" active="true">
<dia:object type="Standard - Line" version="0" id="O0">
<dia:attribute name="obj_pos">
@@ -212,52 +214,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Tree1" version="1" id="O3">
- <dia:attribute name="obj_pos">
- <dia:point val="19.1215,-3.53818"/>
- </dia:attribute>
- <dia:attribute name="obj_bb">
- <dia:rectangle val="18.9042,-3.66546;20.1741,-1.73568"/>
- </dia:attribute>
- <dia:attribute name="meta">
- <dia:composite type="dict"/>
- </dia:attribute>
- <dia:attribute name="elem_corner">
- <dia:point val="19.1215,-3.53818"/>
- </dia:attribute>
- <dia:attribute name="elem_width">
- <dia:real val="0.83536585365853677"/>
- </dia:attribute>
- <dia:attribute name="elem_height">
- <dia:real val="1.7125000000000004"/>
- </dia:attribute>
- <dia:attribute name="line_width">
- <dia:real val="0.089999999999999997"/>
- </dia:attribute>
- <dia:attribute name="line_colour">
- <dia:color val="#000000ff"/>
- </dia:attribute>
- <dia:attribute name="fill_colour">
- <dia:color val="#ffffffff"/>
- </dia:attribute>
- <dia:attribute name="show_background">
- <dia:boolean val="true"/>
- </dia:attribute>
- <dia:attribute name="line_style">
- <dia:enum val="0"/>
- <dia:real val="1"/>
- </dia:attribute>
- <dia:attribute name="flip_horizontal">
- <dia:boolean val="false"/>
- </dia:attribute>
- <dia:attribute name="flip_vertical">
- <dia:boolean val="false"/>
- </dia:attribute>
- <dia:attribute name="subscale">
- <dia:real val="1"/>
- </dia:attribute>
- </dia:object>
- <dia:object type="Cisco - Standing Man" version="1" id="O4">
+ <dia:object type="Cisco - Standing Man" version="1" id="O3">
<dia:attribute name="obj_pos">
<dia:point val="8.94928,10.4508"/>
</dia:attribute>
@@ -302,7 +259,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Cisco - TV" version="1" id="O5">
+ <dia:object type="Cisco - TV" version="1" id="O4">
<dia:attribute name="obj_pos">
<dia:point val="4.78561,7.91626"/>
</dia:attribute>
@@ -347,7 +304,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O6">
+ <dia:object type="Standard - Text" version="1" id="O5">
<dia:attribute name="obj_pos">
<dia:point val="12.9624,12.1879"/>
</dia:attribute>
@@ -380,7 +337,7 @@
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
- <dia:object type="Cisco - STB (set top box)" version="1" id="O7">
+ <dia:object type="Cisco - STB (set top box)" version="1" id="O6">
<dia:attribute name="obj_pos">
<dia:point val="7.36498,9.31536"/>
</dia:attribute>
@@ -425,7 +382,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Line" version="0" id="O8">
+ <dia:object type="Standard - Line" version="0" id="O7">
<dia:attribute name="obj_pos">
<dia:point val="17.0481,1.39917"/>
</dia:attribute>
@@ -440,7 +397,7 @@
<dia:int val="1"/>
</dia:attribute>
<dia:attribute name="line_color">
- <dia:color val="#9668a3ff"/>
+ <dia:color val="#828945ff"/>
</dia:attribute>
<dia:attribute name="line_width">
<dia:real val="0.070000000000000007"/>
@@ -464,7 +421,7 @@
<dia:real val="0.5"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O9">
+ <dia:object type="Standard - Text" version="1" id="O8">
<dia:attribute name="obj_pos">
<dia:point val="4.96367,11.1898"/>
</dia:attribute>
@@ -497,26 +454,26 @@
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O10">
+ <dia:object type="Standard - Text" version="1" id="O9">
<dia:attribute name="obj_pos">
- <dia:point val="20.1947,-2.7356"/>
+ <dia:point val="19.2678,-2.57202"/>
</dia:attribute>
<dia:attribute name="obj_bb">
- <dia:rectangle val="20.1947,-3.3956;23.9897,-2.5381"/>
+ <dia:rectangle val="19.2678,-3.28202;21.3328,-2.35952"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
- <dia:string>#Tree (server)#</dia:string>
+ <dia:string>#Server#</dia:string>
</dia:attribute>
<dia:attribute name="font">
<dia:font family="sans" style="0" name="Helvetica"/>
</dia:attribute>
<dia:attribute name="height">
- <dia:real val="0.76482221393664818"/>
+ <dia:real val="0.8247944355091722"/>
</dia:attribute>
<dia:attribute name="pos">
- <dia:point val="20.1947,-2.7356"/>
+ <dia:point val="19.2678,-2.57202"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000ff"/>
@@ -530,7 +487,7 @@
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Line" version="0" id="O11">
+ <dia:object type="Standard - Line" version="0" id="O10">
<dia:attribute name="obj_pos">
<dia:point val="12.4381,9.93856"/>
</dia:attribute>
@@ -557,7 +514,7 @@
<dia:real val="0.5"/>
</dia:attribute>
</dia:object>
- <dia:object type="Cisco - Radio Tower" version="1" id="O12">
+ <dia:object type="Cisco - Radio Tower" version="1" id="O11">
<dia:attribute name="obj_pos">
<dia:point val="34.7279,-1.54667"/>
</dia:attribute>
@@ -602,7 +559,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Cisco - File Server" version="1" id="O13">
+ <dia:object type="Cisco - File Server" version="1" id="O12">
<dia:attribute name="obj_pos">
<dia:point val="28.6989,3.60233"/>
</dia:attribute>
@@ -647,7 +604,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Cisco - Terminal" version="1" id="O14">
+ <dia:object type="Cisco - Terminal" version="1" id="O13">
<dia:attribute name="obj_pos">
<dia:point val="27.3192,5.42086"/>
</dia:attribute>
@@ -692,7 +649,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Arc" version="0" id="O15">
+ <dia:object type="Standard - Arc" version="0" id="O14">
<dia:attribute name="obj_pos">
<dia:point val="33.8633,-1.81419"/>
</dia:attribute>
@@ -710,16 +667,16 @@
<dia:real val="0.88923828036935093"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Line" version="0" id="O16">
+ <dia:object type="Standard - Line" version="0" id="O15">
<dia:attribute name="obj_pos">
- <dia:point val="28.273,3.99002"/>
+ <dia:point val="28.3728,4.0933"/>
</dia:attribute>
<dia:attribute name="obj_bb">
- <dia:rectangle val="22.4777,1.65416;28.3184,4.06003"/>
+ <dia:rectangle val="22.471,1.65495;28.4184,4.15709"/>
</dia:attribute>
<dia:attribute name="conn_endpoints">
- <dia:point val="28.273,3.99002"/>
- <dia:point val="22.5231,1.72417"/>
+ <dia:point val="28.3728,4.0933"/>
+ <dia:point val="22.5166,1.71874"/>
</dia:attribute>
<dia:attribute name="numcp">
<dia:int val="1"/>
@@ -746,7 +703,7 @@
<dia:real val="0.5"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O17">
+ <dia:object type="Standard - Text" version="1" id="O16">
<dia:attribute name="obj_pos">
<dia:point val="28.2392,7.64919"/>
</dia:attribute>
@@ -779,7 +736,7 @@
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
- <dia:object type="Cisco - Antenna" version="1" id="O18">
+ <dia:object type="Cisco - Antenna" version="1" id="O17">
<dia:attribute name="obj_pos">
<dia:point val="28.4588,1.12127"/>
</dia:attribute>
@@ -824,7 +781,7 @@
<dia:real val="1"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Arc" version="0" id="O19">
+ <dia:object type="Standard - Arc" version="0" id="O18">
<dia:attribute name="obj_pos">
<dia:point val="32.7372,-2.60487"/>
</dia:attribute>
@@ -842,7 +799,7 @@
<dia:real val="1.3338574205540243"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Arc" version="0" id="O20">
+ <dia:object type="Standard - Arc" version="0" id="O19">
<dia:attribute name="obj_pos">
<dia:point val="31.5926,-3.36268"/>
</dia:attribute>
@@ -860,7 +817,7 @@
<dia:real val="1.778476560738703"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Arc" version="0" id="O21">
+ <dia:object type="Standard - Arc" version="0" id="O20">
<dia:attribute name="obj_pos">
<dia:point val="30.4584,-4.13699"/>
</dia:attribute>
@@ -878,12 +835,12 @@
<dia:real val="2.2230957009233752"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O22">
+ <dia:object type="Standard - Text" version="1" id="O21">
<dia:attribute name="obj_pos">
- <dia:point val="23.387,1.42159"/>
+ <dia:point val="23.4167,1.47234"/>
</dia:attribute>
<dia:attribute name="obj_bb">
- <dia:rectangle val="23.3138,0.808571;28.264,3.45318"/>
+ <dia:rectangle val="23.3435,0.859328;28.2937,3.50394"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
@@ -897,7 +854,7 @@
<dia:real val="0.76482221393664818"/>
</dia:attribute>
<dia:attribute name="pos">
- <dia:point val="23.387,1.42159"/>
+ <dia:point val="23.4167,1.47234"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000ff"/>
@@ -914,17 +871,17 @@
<dia:real val="21.75"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O23">
+ <dia:object type="Standard - Text" version="1" id="O22">
<dia:attribute name="obj_pos">
- <dia:point val="10.4552,7.00741"/>
+ <dia:point val="10.3491,7.11348"/>
</dia:attribute>
<dia:attribute name="obj_bb">
- <dia:rectangle val="10.003,2.32823;15.0536,7.15126"/>
+ <dia:rectangle val="9.89688,2.30411;15.0859,7.25733"/>
</dia:attribute>
<dia:attribute name="text">
<dia:composite type="text">
<dia:attribute name="string">
- <dia:string>#BIMU™ (ビム) Stream#</dia:string>
+ <dia:string>#Synced Stream (liana)#</dia:string>
</dia:attribute>
<dia:attribute name="font">
<dia:font family="sans" style="0" name="Helvetica"/>
@@ -933,7 +890,7 @@
<dia:real val="0.76482221393664818"/>
</dia:attribute>
<dia:attribute name="pos">
- <dia:point val="10.4552,7.00741"/>
+ <dia:point val="10.3491,7.11348"/>
</dia:attribute>
<dia:attribute name="color">
<dia:color val="#000000ff"/>
@@ -950,7 +907,7 @@
<dia:real val="-43.25"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O24">
+ <dia:object type="Standard - Text" version="1" id="O23">
<dia:attribute name="obj_pos">
<dia:point val="18.5927,9.60105"/>
</dia:attribute>
@@ -983,7 +940,7 @@
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
- <dia:object type="Standard - Text" version="1" id="O25">
+ <dia:object type="Standard - Text" version="1" id="O24">
<dia:attribute name="obj_pos">
<dia:point val="15.4803,8.49876"/>
</dia:attribute>
@@ -1016,5 +973,104 @@
<dia:enum val="3"/>
</dia:attribute>
</dia:object>
+ <dia:object type="Standard - Text" version="1" id="O25">
+ <dia:attribute name="obj_pos">
+ <dia:point val="37.6358,7.91856"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="37.6358,7.22856;37.6358,8.12356"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>##</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="37.6358,7.91856"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="3"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O26">
+ <dia:attribute name="obj_pos">
+ <dia:point val="34.1144,5.79929"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="34.1144,5.10929;37.9919,6.00429"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#The Internet#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="34.1144,5.79929"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="3"/>
+ </dia:attribute>
+ </dia:object>
+ <dia:object type="Standard - Text" version="1" id="O27">
+ <dia:attribute name="obj_pos">
+ <dia:point val="11.0312,14.5666"/>
+ </dia:attribute>
+ <dia:attribute name="obj_bb">
+ <dia:rectangle val="11.0312,13.8766;12.1112,14.7716"/>
+ </dia:attribute>
+ <dia:attribute name="text">
+ <dia:composite type="text">
+ <dia:attribute name="string">
+ <dia:string>#You#</dia:string>
+ </dia:attribute>
+ <dia:attribute name="font">
+ <dia:font family="sans" style="0" name="Helvetica"/>
+ </dia:attribute>
+ <dia:attribute name="height">
+ <dia:real val="0.80000000000000004"/>
+ </dia:attribute>
+ <dia:attribute name="pos">
+ <dia:point val="11.0312,14.5666"/>
+ </dia:attribute>
+ <dia:attribute name="color">
+ <dia:color val="#000000ff"/>
+ </dia:attribute>
+ <dia:attribute name="alignment">
+ <dia:enum val="0"/>
+ </dia:attribute>
+ </dia:composite>
+ </dia:attribute>
+ <dia:attribute name="valign">
+ <dia:enum val="3"/>
+ </dia:attribute>
+ </dia:object>
</dia:layer>
</dia:diagram>
diff --git a/doc/design.txt b/doc/design.txt
index 95d8b48..ef98961 100644
--- a/doc/design.txt
+++ b/doc/design.txt
@@ -8,8 +8,7 @@ Breif on Components
-------------------
Server
~~~~~~
-The "server" is the main hub responsible for all handling user account related functions and state, as well
-as managing the network of all other individual components.
+The server is the main hub responsible for all handling user account related functions and state, as well as managing the network of all other individual components.
User Accounts
^^^^^^^^^^^^^
@@ -25,15 +24,15 @@ Users accounts contain 4 main concepts: lists, media lists, history, and setting
Node
~~~~
-Nodes can be seen as distributed resource managers for the server. They each contain up to 3 main parts: A source manager and/or database, and a resource host. A node can have one or both of a source manager and database but a node without either is useless.
+Nodes can be seen as distributed resource managers for the server. They each contain up to 3 main parts: A source manager and/or database, then a resource host. A node can have one or both of a source manager and database but a node without either is useless.
Source Manager
^^^^^^^^^^^^^^
-A source manager implements any or all of browsing, searching, and custom resource actions. A big point of a source manager is to be able to work entirely behind a proxy. Some examples of sources include a social media website, filesystem directory, dvd drive, or radio antenna. An example of browsing could be apple music's "New Music". An example of searching, youtube search. A custom action could be liking a post on twitter.
+A source manager implements any or all of browsing, searching, and custom resource actions. A big point of a source manager is to be able to work entirely behind a proxy. Some examples of sources may include a social media website, filesystem directory, dvd drive, or radio antenna. An example of browsing could be apple music's "New Music". An example of searching, youtube search. A custom action could be liking a post on twitter.
Database
^^^^^^^^
-Stores resources locally along with as much metadata as possible. Simply used to retrive resources locally instead of going through the source manager.
+Stores resources along with as much metadata as possible. Simply used to retrive resources locally instead of going through the source manager.
Resource Host
^^^^^^^^^^^^^
@@ -41,7 +40,7 @@ Hosts node-local resources for the server to use for streaming. Should support a
Client
~~~~~~
-Clients are only way a user interacts with the reset of the network besides the special case of play/pause/seek which can also be done from a sink.
+Clients are the only way a user interacts with the rest of the network besides the special case of play, pause, skip and seek which can be done from a sink.
libclient
^^^^^^^^^
@@ -49,10 +48,10 @@ C library that integrates with the rest of the code-base to abstract communicati
Sink
~~~~
-A sink's only purpose is to be a minimal yet optimal way to view the entries in a list.
+A sink's only purpose is to be a minimal, yet optimal, way to view the entries in a list.
libsink
^^^^^^^
-C library that abstracts communicating with the server as a sink in a platform- and environment-independent way. It makes no assumptions about what kind of device (physical or otherwise) it's running on or outputting to.
+C library that abstracts communicating with the server as a sink in a platform- and environment-independent way.
// vim: set syntax=asciidoc:
diff --git a/doc/design_diagram.svg b/doc/design_diagram.svg
index 1c2ed04..693b086 100644
--- a/doc/design_diagram.svg
+++ b/doc/design_diagram.svg
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg width="33cm" height="20cm" viewBox="95 -84 647 390" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<svg width="34cm" height="20cm" viewBox="95 -84 665 390" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <g id="Background"/>
+ <g id="Background"/>
<g id="Background"/>
<g id="Background"/>
<g id="Background"/>
@@ -82,12 +84,6 @@
<path style="fill: none; stroke-opacity: 1; stroke-width: 0.02; stroke: #494936" d="M 387.05 17.1073 L 387.05,8.69594 L 412.16,8.69594"/>
</g>
<g>
- <path style="fill: #800000; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.8; stroke: #000000" fill-rule="evenodd" d="M 389.113 -37.349 C 389.113,-37.349 389.113,-47.3734 389.113,-47.3734 C 389.113,-47.3734 392.454,-47.3734 392.454,-47.3734 C 392.454,-47.3734 392.454,-37.349 392.454,-37.349 C 392.454,-37.349 392.037,-36.5136 390.784,-36.5136 C 389.531,-36.5136 389.113,-37.349 389.113,-37.349z"/>
- <path style="fill: none; stroke-opacity: 1; stroke-width: 1.8; stroke: #000000" d="M 389.113 -37.349 C 389.113,-37.349 389.113,-47.3734 389.113,-47.3734 C 389.113,-47.3734 392.454,-47.3734 392.454,-47.3734 C 392.454,-47.3734 392.454,-37.349 392.454,-37.349 C 392.454,-37.349 392.037,-36.5136 390.784,-36.5136 C 389.531,-36.5136 389.113,-37.349 389.113,-37.349"/>
- <polygon style="fill: #008000; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.8; stroke: #000000" fill-rule="evenodd" points="384.101,-64.0807 386.607,-64.0807 384.101,-57.3977 386.607,-57.3977 384.101,-50.7148 385.771,-50.7148 382.43,-47.3734 399.137,-47.3734 395.796,-50.7148 397.467,-50.7148 394.96,-57.3977 397.467,-57.3977 394.96,-64.0807 397.467,-64.0807 390.784,-70.7636 "/>
- <polygon style="fill: none; stroke-opacity: 1; stroke-width: 1.8; stroke: #00ff00" points="384.101,-64.0807 386.607,-64.0807 384.101,-57.3977 386.607,-57.3977 384.101,-50.7148 385.771,-50.7148 382.43,-47.3734 399.137,-47.3734 395.796,-50.7148 397.467,-50.7148 394.96,-57.3977 397.467,-57.3977 394.96,-64.0807 397.467,-64.0807 390.784,-70.7636 "/>
- </g>
- <g>
<path style="fill: #c9c9b8; fill-opacity: 1; stroke-opacity: 1; stroke-width: 0.02; stroke: #000000" fill-rule="evenodd" d="M 179.448 263.636 L 187.326,263.636 L 178.986,305.797 L 190.334,305.797 L 197.204,274.988 C 197.204,274.988 200.754,299.083 202.377,305.565 C 204.185,305.565 210.681,305.565 214.422,305.565 C 213.725,302.785 207.474,267.114 207.239,263.405 C 208.168,263.405 213.265,263.871 214.885,263.636 C 214.885,261.785 213.497,252.288 213.497,249.971 C 213.497,247.653 211.411,237.231 210.717,234.913 C 210.114,232.906 206.086,229.819 204,229.125 C 201.911,228.428 197.742,228.659 195.428,228.659 C 193.111,228.659 190.539,229.246 188.245,229.816 C 186.394,230.282 184.308,233.287 183.614,235.145 C 182.916,236.996 181.994,242.791 181.3,245.568 C 180.599,248.348 180.371,258.774 179.905,260.393 C 179.442,262.013 179.442,263.636 179.442,263.636 L 179.448,263.636z"/>
<path style="fill: #ffffff; fill-opacity: 1; stroke-opacity: 1; stroke-width: 0.02; stroke: #ffffff" fill-rule="evenodd" d="M 201.611 228.734 C 200.757,228.659 199.372,228.734 198.058,228.659 C 196.748,228.584 194.812,228.659 193.89,228.734 C 192.961,228.809 190.722,229.353 190.49,229.353 C 190.262,229.353 190.106,229.2 190.106,229.2 L 195.666,248.964 L 203.693,229.2 C 203.648,228.633 203.032,228.991 202.654,228.776 L 201.611,228.734z"/>
<path style="fill: none; stroke-opacity: 1; stroke-width: 0.758; stroke: #ffffff" d="M 201.611 228.734 C 200.757,228.659 199.372,228.734 198.058,228.659 C 196.748,228.584 194.812,228.659 193.89,228.734 C 192.961,228.809 190.722,229.353 190.49,229.353 C 190.262,229.353 190.106,229.2 190.106,229.2 L 195.666,248.964 L 203.693,229.2 C 203.648,228.633 203.032,228.991 202.654,228.776"/>
@@ -387,15 +383,15 @@
<path style="fill: none; stroke-opacity: 1; stroke-width: 0.4; stroke: #4e503e" d="M 160.413 197.045 L 160.423,197.087 L 160.432,197.142 L 160.453,197.184 L 160.477,197.233 L 160.514,197.275 L 160.553,197.327 L 160.595,197.369 L 160.653,197.406 L 160.717,197.448 L 160.786,197.487 L 160.859,197.536 L 160.938,197.569 L 161.029,197.606 L 161.12,197.645 L 161.217,197.678 L 161.317,197.709 L 161.423,197.739 L 161.538,197.769 L 161.653,197.803 L 161.771,197.827 L 161.902,197.848 L 162.026,197.872 L 162.156,197.891 L 162.296,197.915 L 162.435,197.933 L 162.577,197.942 L 162.726,197.957 L 162.874,197.972 L 163.026,197.975 L 163.181,197.982 L 163.338,197.991 L 163.496,197.991 L 163.653,197.991 L 163.811,197.982 L 163.965,197.975 L 164.12,197.972 L 164.266,197.957 L 164.414,197.942 L 164.556,197.933 L 164.699,197.915 L 164.835,197.891 L 164.969,197.872 L 165.096,197.848 L 165.217,197.827 L 165.338,197.803 L 165.457,197.769 L 165.569,197.739 L 165.672,197.709 L 165.775,197.678 L 165.872,197.645 L 165.966,197.606 L 166.051,197.569 L 166.132,197.536 L 166.205,197.487 L 166.275,197.448 L 166.336,197.406 L 166.393,197.369 L 166.442,197.327 L 166.478,197.275 L 166.514,197.233 L 166.539,197.184 L 166.563,197.142 L 166.575,197.087 L 166.578,197.045 L 166.575,196.99 L 166.563,196.942 L 166.539,196.897 L 166.514,196.848 L 166.478,196.806 L 166.442,196.76 L 166.393,196.715 L 166.336,196.669 L 166.275,196.63 L 166.205,196.59 L 166.132,196.551 L 166.051,196.515 L 165.966,196.478 L 165.872,196.439 L 165.775,196.403 L 165.672,196.372 L 165.569,196.345 L 165.457,196.312 L 165.338,196.281 L 165.217,196.254 L 165.096,196.233 L 164.969,196.212 L 164.835,196.184 L 164.699,196.172 L 164.556,196.154 L 164.414,196.136 L 164.266,196.121 L 164.12,196.115 L 163.965,196.102 L 163.811,196.099 L 163.653,196.096 L 163.496,196.096 L 163.338,196.096 L 163.181,196.099 L 163.026,196.102 L 162.874,196.115 L 162.726,196.121 L 162.577,196.136 L 162.435,196.154 L 162.296,196.172 L 162.156,196.184 L 162.026,196.212 L 161.902,196.233 L 161.771,196.254 L 161.653,196.281 L 161.538,196.312 L 161.423,196.345 L 161.317,196.372 L 161.217,196.403 L 161.12,196.439 L 161.029,196.478 L 160.938,196.515 L 160.859,196.551 L 160.786,196.59 L 160.717,196.63 L 160.653,196.669 L 160.595,196.715 L 160.553,196.76 L 160.514,196.806 L 160.477,196.848 L 160.453,196.897 L 160.432,196.942 L 160.423,196.99 L 160.413,197.045"/>
</g>
<g>
- <line style="fill: none; stroke-opacity: 1; stroke-width: 1.4; stroke: #9668a3" x1="334.343" y1="34.1776" x2="183.79" y2="175.071"/>
- <polygon style="fill: #9668a3; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #9668a3" fill-rule="evenodd" points="339.819,29.0529 335.934,39.5366 334.343,34.1776 329.101,32.2352 "/>
- <polygon style="fill: #9668a3; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #9668a3" fill-rule="evenodd" points="178.314,180.196 182.199,169.712 183.79,175.071 189.032,177.013 "/>
+ <line style="fill: none; stroke-opacity: 1; stroke-width: 1.4; stroke: #828945" x1="334.343" y1="34.1776" x2="183.79" y2="175.071"/>
+ <polygon style="fill: #828945; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #828945" fill-rule="evenodd" points="339.819,29.0529 335.934,39.5366 334.343,34.1776 329.101,32.2352 "/>
+ <polygon style="fill: #828945; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #828945" fill-rule="evenodd" points="178.314,180.196 182.199,169.712 183.79,175.071 189.032,177.013 "/>
</g>
<text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="99.2734" y="223.796">
<tspan x="99.2734" y="223.796">Sink (libsink)</tspan>
</text>
- <text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="403.894" y="-54.712">
- <tspan x="403.894" y="-54.712">Tree (server)</tspan>
+ <text font-size="13.1967" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="385.356" y="-51.4404">
+ <tspan x="385.356" y="-51.4404">Server</tspan>
</text>
<g>
<line style="fill: none; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" x1="250.777" y1="196.376" x2="337.324" y2="93.4856"/>
@@ -466,9 +462,9 @@
</g>
<path style="fill: none; stroke-opacity: 1; stroke-width: 2; stroke: #cc9f9f" d="M 677.266,-36.2838 A 55.3831,55.3831 0 0 0 696.348,42.7762"/>
<g>
- <line style="fill: none; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" x1="557.026" y1="76.4768" x2="458.896" y2="37.807"/>
- <polygon style="fill: #000000; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" fill-rule="evenodd" points="564.004,79.2265 552.867,80.2121 557.026,76.4768 556.533,70.9084 "/>
- <polygon style="fill: #000000; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" fill-rule="evenodd" points="451.918,35.0573 463.055,34.0717 458.896,37.807 459.389,43.3754 "/>
+ <line style="fill: none; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" x1="559.056" y1="78.4597" x2="458.733" y2="37.7812"/>
+ <polygon style="fill: #000000; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" fill-rule="evenodd" points="566.006,81.2779 554.86,82.1539 559.056,78.4597 558.618,72.8867 "/>
+ <polygon style="fill: #000000; fill-opacity: 1; stroke-opacity: 1; stroke-width: 1.4; stroke: #000000" fill-rule="evenodd" points="451.783,34.963 462.929,34.087 458.733,37.7812 459.171,43.3542 "/>
</g>
<text font-size="12.8" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="564.784" y="152.984">
<tspan x="564.784" y="152.984">Node</tspan>
@@ -487,11 +483,11 @@
<path style="fill: none; stroke-opacity: 1; stroke-width: 2; stroke: #cc9f9f" d="M 654.744,-52.0974 A 83.0743,83.0743 0 0 0 683.366,66.4926"/>
<path style="fill: none; stroke-opacity: 1; stroke-width: 2; stroke: #cc9f9f" d="M 631.852,-67.2536 A 110.766,110.766 0 0 0 670.016,90.8664"/>
<path style="fill: none; stroke-opacity: 1; stroke-width: 2; stroke: #cc9f9f" d="M 609.168,-82.7398 A 138.457,138.457 0 0 0 656.872,114.91"/>
- <text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" transform="translate(467.74,28.4317) rotate(21.75) translate(-467.74,-28.4317)">
- <tspan x="467.74" y="28.4317">Remote Resource</tspan>
+ <text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" transform="translate(468.334,29.4468) rotate(21.75) translate(-468.334,-29.4468)">
+ <tspan x="468.334" y="29.4468">Remote Resource</tspan>
</text>
- <text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" transform="translate(209.104,140.148) rotate(-43.25) translate(-209.104,-140.148)">
- <tspan x="209.104" y="140.148">BIMU™ (ビム) Stream</tspan>
+ <text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" transform="translate(206.982,142.27) rotate(-43.25) translate(-206.982,-142.27)">
+ <tspan x="206.982" y="142.27">Synced Stream (liana)</tspan>
</text>
<text font-size="12.8" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="371.854" y="192.021">
<tspan x="371.854" y="192.021"></tspan>
@@ -499,5 +495,14 @@
<text font-size="12.2372" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="309.606" y="169.975">
<tspan x="309.606" y="169.975">System Interface</tspan>
</text>
+ <text font-size="12.8" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="752.716" y="158.371">
+ <tspan x="752.716" y="158.371"></tspan>
+ </text>
+ <text font-size="12.8" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="682.288" y="115.986">
+ <tspan x="682.288" y="115.986">The Internet</tspan>
+ </text>
+ <text font-size="12.8" style="fill: #000000; fill-opacity: 1; stroke: none;text-anchor:start;font-family:sans-serif;font-style:normal;font-weight:normal" x="220.624" y="291.332">
+ <tspan x="220.624" y="291.332">You</tspan>
+ </text>
</g>
</svg>
diff --git a/doc/network_independent_audio_pause.kra b/doc/network_independent_audio_pause.kra
index c0e39de..91b391e 100644
--- a/doc/network_independent_audio_pause.kra
+++ b/doc/network_independent_audio_pause.kra
Binary files differ
diff --git a/doc/network_independent_audio_pause.png b/doc/network_independent_audio_pause.png
index b5aa516..8e696e2 100644
--- a/doc/network_independent_audio_pause.png
+++ b/doc/network_independent_audio_pause.png
Binary files differ
diff --git a/doc/pal_vs_ntsc_aspect_ratio.png b/doc/references/pal_vs_ntsc_aspect_ratio.png
index e570f70..e570f70 100644
--- a/doc/pal_vs_ntsc_aspect_ratio.png
+++ b/doc/references/pal_vs_ntsc_aspect_ratio.png
Binary files differ
diff --git a/doc/references.txt b/doc/references/references.txt
index 702f7eb..fafba93 100644
--- a/doc/references.txt
+++ b/doc/references/references.txt
@@ -1,4 +1,4 @@
-:stylesheet: style.css
+:stylesheet: ../style.css
= References
diff --git a/doc/style.css b/doc/style.css
index bc6ed15..e52223b 100644
--- a/doc/style.css
+++ b/doc/style.css
@@ -1,7 +1,7 @@
body {
font-family: serif;
margin: 1em 45% 1em 5%;
- background-color: #f4ddca
+ background-color: #fef9fa;
}
h3 {
@@ -9,5 +9,5 @@ h3 {
}
strong {
- color: #543e41;
+ color: #423152;
}
diff --git a/flake.lock b/flake.lock
index df7f46a..36ef2ff 100644
--- a/flake.lock
+++ b/flake.lock
@@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1729256560,
- "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=",
+ "lastModified": 1729413321,
+ "narHash": "sha256-I4tuhRpZFa6Fu6dcH9Dlo5LlH17peT79vx1y1SpeKt0=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0",
+ "rev": "1997e4aa514312c1af7e2bda7fad1644e778ff26",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index bf8bf4f..2faaf91 100644
--- a/flake.nix
+++ b/flake.nix
@@ -154,6 +154,8 @@
buildInputs = with pkgsCross.ucrt64; [
(zlib.override { shared = false; static = true; })
xxHash
+ openssl
+ libidn2
];
shellHook = ''
export NIX_SHELL="camu-mingw64"
diff --git a/meson.build b/meson.build
index abf383b..c088ff4 100644
--- a/meson.build
+++ b/meson.build
@@ -41,7 +41,7 @@ endif
if get_option('server').enabled()
subdir('src/server')
if not meson.is_subproject()
- subdir('src/fruits/cmsrv')
+ subdir('src/fruits/cmsrv')
endif
endif
diff --git a/src/buffer/clock.c b/src/buffer/clock.c
index c4a07a6..a04bb08 100644
--- a/src/buffer/clock.c
+++ b/src/buffer/clock.c
@@ -59,7 +59,6 @@ void camu_clock_resume(struct camu_clock *clock, u64 target)
//} else if (target > 0) {
if (target > 0) {
tick = calc_tick_offset(tick, aki_get_timestamp(), target);
- al_printf("%f\n", tick);
}
if (clock->paused_at == 0.0) {
if (target == 0) {
diff --git a/src/buffer/video.c b/src/buffer/video.c
index b2381b2..a7a5594 100644
--- a/src/buffer/video.c
+++ b/src/buffer/video.c
@@ -149,6 +149,7 @@ void camu_video_buffer_push(struct camu_video_buffer *buf, struct camu_codec_fra
// Not thread-safe, must be called while the buffer is not being read from or written to.
void camu_video_buffer_reset(struct camu_video_buffer *buf)
{
+ buf->pts = -1.0;
buf->queue->reset(buf->queue);
buf->buffered = false;
al_atomic_store(u8)(&buf->flow, FLOWING, AL_ATOMIC_RELAXED);
@@ -172,7 +173,7 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out)
f64 pts = camu_clock_get_pts(buf->clock, buf->latency);
if (pts > buf->pts) buf->pts = pts;
}
- u8 flow = al_atomic_load(u8)(&buf->flow, AL_ATOMIC_RELAXED);
+ u8 flow = al_atomic_load(u8)(&buf->flow, AL_ATOMIC_ACQUIRE);
if (flow == SIGNALED && !buf->single_frame) {
buf->callback(buf->userdata, CAMU_BUFFER_EOF);
return false;
@@ -180,7 +181,7 @@ bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out)
u8 ret = buf->queue->read(buf->queue, buf->pts, out);
if (flow == FLUSHED && (ret == CAMU_QUEUE_EOF || (buf->single_frame && ret == CAMU_QUEUE_OK))) {
buf->callback(buf->userdata, CAMU_BUFFER_EOF);
- al_atomic_store(u8)(&buf->flow, SIGNALED, AL_ATOMIC_RELAXED);
+ al_atomic_store(u8)(&buf->flow, SIGNALED, AL_ATOMIC_RELEASE);
al_log_debug("video_buffer", "Flushed.");
} else if (flow == FLOWING && buf->queue->count(buf->queue) <= BUFFER_WATERMARK_LOW) {
buf->callback(buf->userdata, CAMU_BUFFER_UNCORK);
diff --git a/src/cache/meson.build b/src/cache/meson.build
index 8684ccd..5fb47ae 100644
--- a/src/cache/meson.build
+++ b/src/cache/meson.build
@@ -3,9 +3,24 @@ cache_src = [
'handle.c',
'threaded_waits.c',
'handlers/file.c',
- 'handlers/cdio.c',
'backings/memory.c'
]
+cache_deps = []
+
+cache_have_cdio = false
+libcdio_paranoia = dependency('libcdio_paranoia', required: false, allow_fallback: true)
+libcdio_cdda = dependency('libcdio_cdda', required: false, allow_fallback: true)
+if libcdio_paranoia.found() and libcdio_cdda.found()
+ cache_src += ['handlers/cdio.c']
+ cache_deps += [libcdio_paranoia, libcdio_cdda]
+ cache_have_cdio = true
+endif
+
+#libdvdcss = dependency('libdvdcss', required: false, allow_fallback: true)
+#libdvdread = dependency('libdvdread', required: false, allow_fallback: true)
+#libdvdnav = dependency('libdvdnav', required: false, allow_fallback: true)
+#if libdvdcss.found() and libdvdread.found() and libdvdnav.found()
+#endif
if akiyo_has_mmap
cache_src += ['backings/file_mapped.c']
@@ -17,4 +32,4 @@ if akiyo_has_curl
cache_src += ['handlers/http.c']
endif
-cache = declare_dependency(sources: cache_src)
+cache = declare_dependency(sources: cache_src, dependencies: cache_deps)
diff --git a/src/codec/ffmpeg/decoder.c b/src/codec/ffmpeg/decoder.c
index d231b2f..3aafd35 100644
--- a/src/codec/ffmpeg/decoder.c
+++ b/src/codec/ffmpeg/decoder.c
@@ -14,6 +14,8 @@ static bool ff_decoder_init(struct camu_decoder *dec, struct camu_renderer *rend
{
struct camu_ff_decoder *av = (struct camu_ff_decoder *)dec;
+ av->codec_context = NULL;
+
AVCodecParameters *codecpar = stream->av.stream->codecpar;
const AVCodec *codec = avcodec_find_decoder(codecpar->codec_id);
diff --git a/src/liana/client.c b/src/liana/client.c
index d556453..5e33086 100644
--- a/src/liana/client.c
+++ b/src/liana/client.c
@@ -5,6 +5,7 @@
#include "client.h"
#include "handlers.h"
+#include "list.h"
static void data_packet_callback(void *userdata, struct aki_packet_stream *stream, struct aki_packet *packet)
{
@@ -84,9 +85,17 @@ static void parse_info_packet(struct lia_client *client, struct aki_packet *pack
track->client->callback = client->callback;
track->client->userdata = client->userdata;
track->stream.mode = mode;
- if (track->client->init(track->client, client->renderer, &track->stream)) {
- client->callback(client->userdata, LIANA_CLIENT_CONFIGURE, track->client->stream, track);
+ if (!track->client->init(track->client, client->renderer, &track->stream)) {
+ track->client->free(&track->client);
+#if CAMU_HAVE_FFMPEG
+ if (track->stream.mode == CAMU_FFMPEG_COMPAT) {
+ avformat_free_context(track->stream.av.format_context);
+ }
+#endif
+ al_free(track);
+ continue;
}
+ client->callback(client->userdata, LIANA_CLIENT_CONFIGURE, track->client->stream, track);
lia_vcr_add_track(&client->vcr, track);
}
}
@@ -141,6 +150,12 @@ static void connection_closed_callback(void *userdata, struct aki_packet_stream
client->callback(client->userdata, LIANA_CLIENT_REMOVE_BUFFERS, NULL, &client->reconnect);
if (client->reconnect) {
client->reconnect = false;
+ struct lia_timing time = {
+ .at = client->at,
+ .seek_pos = client->pos,
+ .pause = LIANA_PAUSE_NONE
+ };
+ client->callback(client->userdata, LIANA_CLIENT_RESUME_AT, NULL, &time);
aki_packet_stream_reconnect(stream, &client->addr, client->port);
} else {
client->callback(client->userdata, LIANA_CLIENT_CLOSED, NULL, NULL);
@@ -173,10 +188,11 @@ void lia_client_set_renderer(struct lia_client *client, struct camu_renderer *re
client->renderer = renderer;
}
-void lia_client_seek(struct lia_client *client, u64 pos)
+void lia_client_seek(struct lia_client *client, u64 pos, u64 at)
{
client->reconnect = true;
client->pos = pos;
+ client->at = at;
aki_packet_stream_disconnect(&client->data);
}
diff --git a/src/liana/client.h b/src/liana/client.h
index 5c16cd8..24526af 100644
--- a/src/liana/client.h
+++ b/src/liana/client.h
@@ -11,6 +11,7 @@ struct lia_client {
u16 id;
s32 mask;
u64 pos;
+ u64 at;
bool reconnect;
str addr;
u16 port;
@@ -25,7 +26,7 @@ struct lia_client {
void lia_client_connect(struct lia_client *client, struct aki_event_loop *loop, u8 type,
str *addr, u16 port, u16 id, u64 pos, struct camu_renderer *renderer);
-void lia_client_seek(struct lia_client *client, u64 pos);
+void lia_client_seek(struct lia_client *client, u64 pos, u64 at);
void lia_client_reseek(struct lia_client *client);
void lia_client_disconnect(struct lia_client *client);
void lia_client_free(struct lia_client *client);
diff --git a/src/liana/handler.h b/src/liana/handler.h
index 6c23ac5..f994069 100644
--- a/src/liana/handler.h
+++ b/src/liana/handler.h
@@ -25,11 +25,9 @@ enum {
enum {
LIANA_CLIENT_CONFIGURE = 0,
- LIANA_CLIENT_SET,
- LIANA_CLIENT_PAUSE,
- LIANA_CLIENT_RESUME,
LIANA_CLIENT_DATA,
LIANA_CLIENT_REMOVE_BUFFERS,
+ LIANA_CLIENT_RESUME_AT,
LIANA_CLIENT_EOF,
LIANA_CLIENT_CLOSED
};
diff --git a/src/liana/handlers/cdio_server.c b/src/liana/handlers/cdio_server.c
index 1eaf6f3..118f6b5 100644
--- a/src/liana/handlers/cdio_server.c
+++ b/src/liana/handlers/cdio_server.c
@@ -1,5 +1,4 @@
#include <al/log.h>
-#include <cdio/paranoia/cdda.h>
#include "../../cache/entry.h"
#include "../../cache/handlers/cdio.h"
diff --git a/src/liana/list.c b/src/liana/list.c
index 37a144f..18bfd6c 100644
--- a/src/liana/list.c
+++ b/src/liana/list.c
@@ -59,7 +59,7 @@ void lia_list_add_sink(struct lia_list *list, void (*callback)(void *, u8, struc
u64 seek_pos = current->offset;
if (current->paused_at == LIANA_TIMESTAMP_INVALID) {
now += LIANA_BASE_DELAY;
- if (now > current->start) {
+ if (now > current->start && now - current->start > LIANA_BASE_DELAY) {
at = now;
seek_pos += now - current->start;
} else {
@@ -333,7 +333,7 @@ void lia_list_end(struct lia_list *list, s32 sequence)
s32 next = sequence + 1;
list->previous = sequence;
struct lia_list_entry *current = al_array_at(list->entries, list->current);
- //current->offset = current->duration;
+ current->offset = current->duration;
if (list->queued >= 0) {
list->current = list->queued;
list->queued = -1;
diff --git a/src/liana/list.h b/src/liana/list.h
index 8adea17..eb9a3cb 100644
--- a/src/liana/list.h
+++ b/src/liana/list.h
@@ -25,25 +25,10 @@ enum {
LIANA_META_QUEUED
};
-// Pause:
-// - Set `paused_at` to now() + PAUSE_DELAY.
-// - Increment `offset` by how long the entry will have been
-// playing when paused at the requested timestamp (`paused_at` - `start`).
-// Resume:
-// - Unset `paused_at`
-// - Set `start` to now() + PAUSE_DELAY.
-// Next/Prev:
-// Current Playing, Target Playing:
-// - Set `current->held_at` to now() + PAUSE_DELAY.
-// - Increment `current->offset` by the same logic as pause.
-// -
-// Current Playing, Target Paused:
-// Current Paused, Target Playing:
-// Current Paused, Target Paused:
-// Seek:
+// NOTE: To handle an entry being queued right before a skip, keep a global
+// "max time until all sinks buffered" and used that instead of LIANA_PAUSE_DELAY (if greater).
-// NOTE: keep global per list max time until all sinks _should_ by buffered
-// possibly use that instead of LIANA_PAUSE_DELAY.
+// TODO: Factor in LIANA_BASE_PING.
enum {
LIANA_PAUSE_NONE = 0,
diff --git a/src/liana/meson.build b/src/liana/meson.build
index 0859e99..da53214 100644
--- a/src/liana/meson.build
+++ b/src/liana/meson.build
@@ -13,23 +13,12 @@ liana_client_src = [
liana_deps = [codecs]
liana_args = []
-libcdio_paranoia = dependency('libcdio_paranoia', required: false, allow_fallback: true)
-libcdio_cdda = dependency('libcdio_cdda', required: false, allow_fallback: true)
-if libcdio_paranoia.found() and libcdio_cdda.found()
+if cache_have_cdio
liana_server_src += ['handlers/cdio_server.c']
liana_client_src += ['handlers/cdio_client.c']
- liana_deps += [libcdio_paranoia, libcdio_cdda]
liana_args += ['-DLIANA_HAVE_CDIO']
endif
-#libdvdcss = dependency('libdvdcss', required: false, allow_fallback: true)
-#libdvdread = dependency('libdvdread', required: false, allow_fallback: true)
-#libdvdnav = dependency('libdvdnav', required: false, allow_fallback: true)
-#if libdvdcss.found() and libdvdread.found() and libdvdnav.found()
-# liana_server_src += ['handlers/dvd_server.c']
-# liana_server_deps += [libdvdcss]
-#endif
-
liana_server = declare_dependency(sources: liana_server_src, dependencies: liana_deps,
compile_args: [liana_args, '-DLIANA_SERVER'])
liana_client = declare_dependency(sources: liana_client_src, dependencies: liana_deps,
diff --git a/src/liana/vcr.c b/src/liana/vcr.c
index fad8b78..39fe0fe 100644
--- a/src/liana/vcr.c
+++ b/src/liana/vcr.c
@@ -123,7 +123,11 @@ bool lia_vcr_push_packet(struct lia_vcr *vcr, struct aki_packet *packet)
switch (op) {
case LIANA_PACKET_DATA:
track = get_track_from_index(vcr, aki_packet_read_s32(packet));
- al_assert(track);
+ if (!track) {
+ al_log_warn("liana", "Received data from errored or unknown track.");
+ aki_packet_free(packet);
+ return false;
+ }
if (!track->running) {
aki_thread_create(&track->thread, vcr_track_thread, track);
track->running = true;
diff --git a/src/libsink/common.h b/src/libsink/common.h
index deae228..f8dd9fa 100644
--- a/src/libsink/common.h
+++ b/src/libsink/common.h
@@ -1,6 +1,6 @@
#pragma once
-#define CAMU_SINK_LOCAL 0
+#define CAMU_SINK_LOCAL 1
enum {
CAMU_SINK_SET = 0,
diff --git a/src/libsink/sink.c b/src/libsink/sink.c
index 859b717..990cd69 100644
--- a/src/libsink/sink.c
+++ b/src/libsink/sink.c
@@ -210,7 +210,7 @@ static void handle_sink_cmd(struct camu_sink *sink, struct camu_sink_cmd *cmd)
case SKIP: {
if (!sink->conn) return;
struct aki_packet *packet = aki_rpc_get_packet(&sink->client, CAMU_SERVER_LIST_ACTION);
- aki_packet_write_str(packet, al_str_c("default"));
+ aki_packet_write_str(packet, &sink->default_list);
aki_packet_write_u8(packet, CAMU_LIST_SKIP);
//s32 sequence = sink->current ? sink->current->sequence : LIANA_SEQUENCE_ANY;
s32 sequence = LIANA_SEQUENCE_ANY;
@@ -222,7 +222,7 @@ static void handle_sink_cmd(struct camu_sink *sink, struct camu_sink_cmd *cmd)
case SHUFFLE: {
if (!sink->conn) return;
struct aki_packet *packet = aki_rpc_get_packet(&sink->client, CAMU_SERVER_LIST_ACTION);
- aki_packet_write_str(packet, al_str_c("default"));
+ aki_packet_write_str(packet, &sink->default_list);
aki_packet_write_u8(packet, CAMU_LIST_SHUFFLE);
aki_rpc_connection_command(sink->conn, packet, NULL, NULL);
break;
@@ -233,7 +233,7 @@ static void handle_sink_cmd(struct camu_sink *sink, struct camu_sink_cmd *cmd)
#else
if (!sink->conn) return;
struct aki_packet *packet = aki_rpc_get_packet(&sink->client, CAMU_SERVER_LIST_ACTION);
- aki_packet_write_str(packet, al_str_c("default"));
+ aki_packet_write_str(packet, &sink->default_list);
aki_packet_write_u8(packet, CAMU_LIST_TOGGLE_PAUSE);
s32 sequence = sink->current ? sink->current->sequence : LIANA_SEQUENCE_ANY;
aki_packet_write_s32(packet, sequence);
@@ -245,7 +245,7 @@ static void handle_sink_cmd(struct camu_sink *sink, struct camu_sink_cmd *cmd)
case SEEK: {
if (!sink->conn) return;
struct aki_packet *packet = aki_rpc_get_packet(&sink->client, CAMU_SERVER_LIST_ACTION);
- aki_packet_write_str(packet, al_str_c("default"));
+ aki_packet_write_str(packet, &sink->default_list);
aki_packet_write_u8(packet, CAMU_LIST_SEEK);
s32 sequence = sink->current ? sink->current->sequence : LIANA_SEQUENCE_ANY;
aki_packet_write_s32(packet, sequence);
@@ -256,7 +256,7 @@ static void handle_sink_cmd(struct camu_sink *sink, struct camu_sink_cmd *cmd)
case END: {
if (!sink->conn) return;
struct aki_packet *packet = aki_rpc_get_packet(&sink->client, CAMU_SERVER_LIST_ACTION);
- aki_packet_write_str(packet, al_str_c("default"));
+ aki_packet_write_str(packet, &sink->default_list);
aki_packet_write_u8(packet, CAMU_LIST_END);
aki_packet_write_s32(packet, cmd->value.i);
aki_rpc_connection_command(sink->conn, packet, NULL, NULL);
@@ -546,6 +546,12 @@ static void client_callback(void *userdata, u8 op, struct camu_codec_stream *str
camu_audio_buffer_reset(&entry->audio.buf);
break;
}
+ case LIANA_CLIENT_RESUME_AT: {
+ struct lia_timing *time = (struct lia_timing *)opaque;
+ camu_clock_set(&entry->clock, time->seek_pos / 1000000.0);
+ camu_clock_resume(&entry->clock, time->at);
+ break;
+ }
case LIANA_CLIENT_EOF: {
switch (stream->type) {
case CAMU_STREAM_AUDIO: {
@@ -917,10 +923,12 @@ static bool seek_command_callback(void *userdata, struct aki_rpc_connection *con
struct camu_sink_entry *current = sink->current;
aki_mutex_unlock(&sink->mutex);
if (current->sequence == sequence) {
- // TODO: Thread-safety here.
- lia_client_seek(&current->client, pos);
- camu_clock_set(&current->clock, pos / 1000000.0);
- camu_clock_resume(&current->clock, at);
+#if CAMU_SINK_LOCAL
+ (void)at;
+ lia_client_seek(&current->client, pos, 0);
+#else
+ lia_client_seek(&current->client, pos, at);
+#endif
}
aki_packet_free(packet);
diff --git a/src/libsink/sink.h b/src/libsink/sink.h
index b9249cd..6d560f6 100644
--- a/src/libsink/sink.h
+++ b/src/libsink/sink.h
@@ -72,6 +72,7 @@ struct camu_sink {
struct aki_signal signal;
queue(struct camu_sink_cmd) queue;
struct aki_mutex mutex;
+ str default_list;
struct camu_sink_entry *current;
struct camu_sink_entry *queued;
struct camu_sink_entry *target;
diff --git a/src/server/local_compat.c b/src/server/local_compat.c
index 9870ce5..39698c5 100644
--- a/src/server/local_compat.c
+++ b/src/server/local_compat.c
@@ -4,7 +4,9 @@
#include "../cache/handlers/http.h"
#endif
#include "../cache/handlers/file.h"
+#ifdef LIANA_HAVE_CDIO
#include "../cache/handlers/cdio.h"
+#endif
#include "local_compat.h"
#include "common.h"
@@ -84,14 +86,15 @@ static void worker_signal_callback(void *userdata)
static aki_thread_result AKI_THREADCALL queue_thread(void *userdata)
{
struct camu_local_compat *compat = (struct camu_local_compat *)userdata;
+ aki_thread_setcanceltype(AKI_THREAD_CANCEL_ASYNCHRONOUS);
#ifdef CAMU_HAVE_PORTAL
bool have_python = false;
#endif
u32 count;
while (aki_packet_cache_wait(&compat->queue, &count)) {
struct aki_packet *packet = aki_packet_cache_pop(&compat->queue);
+ aki_packet_cache_unlock(&compat->queue);
if (!packet) {
- aki_packet_cache_unlock(&compat->queue);
break;
}
str local;
@@ -99,6 +102,7 @@ static aki_thread_result AKI_THREADCALL queue_thread(void *userdata)
struct cch_entry *entry = NULL;
struct camu_post *post = NULL;
if (al_str_cmp(&local, al_str_c("cdda://"), 0, 7) == 0) {
+#ifdef LIANA_HAVE_CDIO
entry = cch_handler_cdio_create();
struct cch_chapter *chapter = &al_array_at(entry->chapters, 0);
if (local.len > 7) {
@@ -109,6 +113,7 @@ static aki_thread_result AKI_THREADCALL queue_thread(void *userdata)
}
entry->chapter = chapter;
entry->handler->maybe_spawn_worker(entry->handler, chapter->start);
+#endif
} else {
#ifdef CAMU_HAVE_PORTAL
#ifndef AKIYO_HAS_CURL
@@ -141,7 +146,6 @@ static aki_thread_result AKI_THREADCALL queue_thread(void *userdata)
#endif
#endif
}
- aki_packet_cache_unlock(&compat->queue);
if (entry) {
struct camu_server_resource *resource = al_alloc_object(struct camu_server_resource);
al_str_clone(&resource->unique_id, &local);
@@ -203,7 +207,9 @@ void camu_local_compat_send(struct camu_local_compat *compat, struct aki_packet
void camu_local_compat_stop(struct camu_local_compat *compat)
{
aki_packet_cache_disable(&compat->queue);
+ aki_thread_cancel(&compat->thread);
aki_thread_join(&compat->thread);
+ aki_signal_stop(&compat->worker_signal);
aki_signal_stop(&compat->result_signal);
camu_queue_free(compat->results);
struct aki_packet *packet;
diff --git a/src/sink/desktop.c b/src/sink/desktop.c
index 8e628fd..ddde86b 100644
--- a/src/sink/desktop.c
+++ b/src/sink/desktop.c
@@ -156,6 +156,7 @@ bool camu_desktop_connect(struct camu_desktop *c, u8 type, struct aki_event_loop
{
c->loop = loop;
camu_sink_init(&c->sink, c->loop, &c->mixer, c->renderer);
+ al_str_from(&c->sink.default_list, "default");
c->sink.callback = sink_callback;
c->sink.userdata = c;
return camu_sink_connect(&c->sink, type, addr, port, al_str_c("desktop"));