Skip to content

Commit

Permalink
Fix external encoder. Fixes: #3020
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Apr 23, 2023
1 parent d6313d1 commit 4ea8e96
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version=0.24.1
version=0.25.1
profile = conventional
break-separators = after
space-around-lists = false
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Fixed:
* Fixed non-monotonous PTS in ffmpeg raw content (#2978)
* Fixed external encoder (#3020)

2.1.4 (2022-03-01)
=====
Expand Down
10 changes: 5 additions & 5 deletions src/encoder/external_encoder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ let encoder id ext =
let encode frame start len =
let channels = ext.channels in
let samplerate = Lazy.force ext.samplerate in
let width, height = Option.get ext.video in
let width = Lazy.force width in
let height = Lazy.force height in
let sbuf =
if ext.video <> None then
if ext.video <> None then (
let width, height = Option.get ext.video in
let width = Lazy.force width in
let height = Lazy.force height in
Avi_encoder.encode_frame ~channels ~samplerate ~converter ~width ~height
frame start len
frame start len)
else (
let b = AFrame.pcm frame in
let start = Frame.audio_of_main start in
Expand Down
13 changes: 13 additions & 0 deletions tests/regression/external-encoder.liq
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
s = sine()

tmp = file.temp("foo", "flv")
on_shutdown({file.remove(tmp)})

encoder = %external(process="cat")

output.file(
encoder,
"/tmp/cat",
on_start=test.pass,
sine()
)

0 comments on commit 4ea8e96

Please sign in to comment.