Skip to content

Commit

Permalink
Minor bump for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Dec 4, 2024
1 parent 442867d commit 667446e
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion liquidsoap-core.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Liquidsoap core library and binary"
maintainer: ["The Savonet Team <[email protected]>"]
authors: ["The Savonet Team <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion liquidsoap-js.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Liquidsoap language - javascript wrapper"
maintainer: ["The Savonet Team <[email protected]>"]
authors: ["The Savonet Team <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion liquidsoap-lang.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Liquidsoap language library"
maintainer: ["The Savonet Team <[email protected]>"]
authors: ["The Savonet Team <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion liquidsoap-libs-extra.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Liquidosap standard library -- extra functionalities"
maintainer: ["The Savonet Team <[email protected]>"]
authors: ["The Savonet Team <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion liquidsoap-libs.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Liquidosap standard library"
maintainer: ["The Savonet Team <[email protected]>"]
authors: ["The Savonet Team <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion liquidsoap-mode.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Liquidosap emacs mode"
maintainer: ["The Savonet Team <[email protected]>"]
authors: ["The Savonet Team <[email protected]>"]
Expand Down
6 changes: 3 additions & 3 deletions liquidsoap.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "2.4.0"
version: "2.3.1"
synopsis: "Swiss-army knife for multimedia streaming"
description: """
Liquidsoap is a powerful and flexible language for describing your
Expand All @@ -18,8 +18,8 @@ bug-reports: "https://github.com/savonet/liquidsoap/issues"
depends: [
"dune" {>= "3.6"}
"liquidsoap-core" {= version}
"liquidsoap-libs" {>= "2.3.0" & < "2.3.1"}
"liquidsoap-libs-extra" {>= "2.3.0" & < "2.3.1"}
"liquidsoap-libs" {>= "2.3.1" & < "2.3.2"}
"liquidsoap-libs-extra" {>= "2.3.1" & < "2.3.2"}
"pandoc" {with-doc}
"pandoc-include" {with-doc}
"odoc" {with-doc}
Expand Down
45 changes: 23 additions & 22 deletions src/core/io/alsa_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,12 @@ class output ~self_sync ~start ~infallible ~register_telnet ~on_stop ~on_start
(float alsa_rate /. float samples_per_second)
buf 0 len
in
try
let r = ref ofs in
while !r < len do
if !r <> 0 then
self#log#info
"Partial write (%d instead of %d)! Selecting another buffer size \
or device can help."
!r len;
r := !r + write pcm buf !r (len - !r)
done
let rec pcm_write ofs len =
if 0 < len then (
let written = write pcm buf ofs len in
pcm_write (ofs + written) (len - written))
in
try write ofs len
with e ->
begin
match e with
Expand All @@ -220,7 +216,6 @@ class output ~self_sync ~start ~infallible ~register_telnet ~on_stop ~on_start
end

class input ~self_sync ~start ~on_stop ~on_start ~fallible dev =
let samples_per_frame = AFrame.size () in
object (self)
inherit base ~self_sync dev [Pcm.Capture]

Expand All @@ -235,24 +230,30 @@ class input ~self_sync ~start ~on_stop ~on_start ~fallible dev =
method abort_track = ()
method seek_source = (self :> Source.source)
method private can_generate_frame = active_source#started
val mutable gen = None

method generator =
match gen with
| Some g -> g
| None ->
let g = Generator.create self#content_type in
gen <- Some g;
g

(* TODO: convert samplerate *)
method private generate_frame =
let pcm = Option.get pcm in
let length = Lazy.force Frame.size in
let frame = Frame.create ~length self#content_type in
let buf = Content.Audio.get_data (Frame.get frame Frame.Fields.audio) in
let gen = self#genetator in
try
let r = ref 0 in
while !r < samples_per_frame do
if !r <> 0 then
self#log#info
"Partial read (%d instead of %d)! Selecting another buffer size \
or device can help."
!r (Audio.length buf);
r := !r + read pcm buf !r (samples_per_frame - !r)
while Generator.length gen < length do
let c = Content.make ~length self#content_type in
let read =
read pcm (Content.Audio.get_data c) 0 (Frame.audio_of_main length)
in
Genetator.put gen Frame.Fields.audio (Content.sub c 0 read)
done;
Frame.set_data frame Frame.Fields.audio Content.Audio.lift_data buf
Generator.slice gen length
with e ->
begin
match e with
Expand Down

0 comments on commit 667446e

Please sign in to comment.