File: on_offset.liq

package info (click to toggle)
liquidsoap 2.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,844 kB
  • sloc: ml: 74,136; javascript: 27,320; ansic: 505; sh: 139; xml: 114; lisp: 96; makefile: 26
file content (19 lines) | stat: -rw-r--r-- 338 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def f() =
  s = single("./file1.mp3")
  s.on_position(
    position=1.2,
    synchronous=true,
    fun (pos, _) ->
      begin
        if s.elapsed() < 1.2 then test.fail() end
        if pos != s.elapsed() then test.fail() end
        test.pass()
      end
  )

  clock.assign_new(sync='none', [s])

  output.dummy(s)
end

test.check(f)