Closed toots closed 3 years ago
I was able to reproduce with this script without needing to minimize it:
def transition(a,b)
# If old or new source is not music, no fade
if a.metadata["source_tag"] != "music" or a.metadata["source_tag"] != "music" then
sequence([a.source, b.source])
else
# Else, apply the standard smart transition
cross.smart(a, b)
end
end
# A function to add a source_tag metadata to a source:
def source_tag(s,tag) =
def f(_)
[("source_tag",(tag:string))]
end
map_metadata(id=tag,insert_missing=true,f,s)
end
def f(_) =
blank(duration=2.)
end
# Tag our sources
default = blank()
music = request.dynamic.list({[request.create("/tmp/bla.mp3")]})
music = source_tag(music, "music")
music = amplify(1.,override="replaygain_track_gain", music)
music = chop(music)
music = append(music, f)
music = blank.skip(music, max_blank=0.5, threshold=-50.)
radio = music
radio = cross(duration=5., transition, radio)
st = pipe(process='stereo_tool - - -q', radio)
s = fallback(track_sensitive=false, [st, default])
output.ao(s)
Commit 5557ba3 seems to have fixed it. My understanding of the issue is that, with the new Child_support
implementation, there was a chance get_to_write
and after_output
would both call source#get
during a single streaming loop, leading to the last one not adding an extra break. I haven't investigated more but, with this fix, we let the piping process drive the child source's clock entirely while it is running and resort to the default Child_support
after_output
based mechanism only when the process is not active.
Issue is described in discussion https://github.com/savonet/liquidsoap/discussions/1782
Reference script:
Log: