CC-5226: Metadata isn't correct during playing

-fixed using "insert_metadata" and callbacks instead.
This commit is contained in:
Martin Konecny 2013-06-12 14:04:52 -04:00
parent 4e71345a61
commit 949ae9667b
2 changed files with 8 additions and 7 deletions

View File

@ -5,7 +5,8 @@ def notify(m)
end end
def notify_queue(m) def notify_queue(m)
queue_metadata := m f = !dynamic_metadata_callback
ignore(f(m))
notify(m) notify(m)
end end
@ -31,10 +32,6 @@ def append_title(m) =
end end
end end
def queue_metadata_callback(m) =
!queue_metadata
end
def crossfade_airtime(s) def crossfade_airtime(s)
#duration is automatically overwritten by metadata fields passed in #duration is automatically overwritten by metadata fields passed in
#with audio #with audio

View File

@ -24,7 +24,7 @@ default_dj_fade = ref 0.
station_name = ref '' station_name = ref ''
show_name = ref '' show_name = ref ''
queue_metadata = ref [] dynamic_metadata_callback = ref fun (s) -> begin () end
s1_connected = ref '' s1_connected = ref ''
s2_connected = ref '' s2_connected = ref ''
@ -72,7 +72,11 @@ create_source()
queue = add(!sources, normalize=false) queue = add(!sources, normalize=false)
queue = map_metadata(update=false, queue_metadata_callback, queue) pair = insert_metadata(queue)
f = fst(pair)
queue = snd(pair)
dynamic_metadata_callback := f
output.dummy(fallible=true, queue) output.dummy(fallible=true, queue)