Skip to content

Commit 5051234

Browse files
committed
Fix this.
1 parent c025294 commit 5051234

File tree

1 file changed

+45
-72
lines changed

1 file changed

+45
-72
lines changed

tests/streams/hls_id3v2.liq

Lines changed: 45 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
s = sine()
2-
32
s = insert_metadata(s)
43

54
def f() =
6-
s.insert_metadata([("title", "test title"), ("album","foolol")])
5+
s.insert_metadata(
6+
[
7+
(
8+
"title",
9+
"test title"
10+
),
11+
("album", "foolol")
12+
]
13+
)
714
end
815

916
thread.run(every=2., f)
10-
1117
s = mksafe(s)
12-
1318
tmp_dir = file.temp_dir("tmp")
1419
on_cleanup({file.rmdir(tmp_dir)})
15-
1620
output.file.hls(
1721
tmp_dir,
1822
[
19-
<<<<<<< HEAD
20-
("aac", %ffmpeg(format="adts",%audio(codec="aac")).{id3_version = 3}),
21-
("ts_with_meta", %ffmpeg(format="mpegts",%audio(codec="aac")).{id3_version = 4}),
22-
("ts", %ffmpeg(format="mpegts",%audio(codec="aac")).{ id3=false }),
23-
("mp4", %ffmpeg(format="mp4",frag_duration=10,movflags="+dash+skip_sidx+skip_trailer+frag_custom",%audio(codec="aac")))
24-
=======
2523
("aac", %ffmpeg(format = "adts", %audio(codec = "aac")).{id3_version=3}),
2624
(
2725
"ts_with_meta",
@@ -40,27 +38,10 @@ output.file.hls(
4038
%audio(codec = "aac")
4139
)
4240
)
43-
>>>>>>> 118cc1bad (Enable id3v2 tags in HLS for all encoders. (#3604))
4441
],
4542
s
4643
)
4744

48-
<<<<<<< HEAD
49-
to_check = ref({
50-
aac = null(),
51-
ts_with_meta = null(),
52-
ts = null(),
53-
mp4 = null()
54-
})
55-
56-
def check_done() =
57-
let { aac, ts_with_meta, ts, mp4 } = to_check()
58-
59-
if null.defined(ts) then test.fail("ts shouldn't have metadata!") end
60-
if null.defined(mp4) then test.fail("mp4 should have metadata but it's not supported by the demuxer yet.") end
61-
62-
if null.defined(aac) and null.defined(ts_with_meta) then
63-
=======
6445
to_check =
6546
ref(
6647
{
@@ -96,14 +77,9 @@ def check_done() =
9677
if
9778
null.defined(aac) and null.defined(fdkaac) and null.defined(ts_with_meta)
9879
then
99-
>>>>>>> 118cc1bad (Enable id3v2 tags in HLS for all encoders. (#3604))
10080
aac = null.get(aac)
10181
fdkaac = null.get(fdkaac)
10282
ts_with_meta = null.get(ts_with_meta)
103-
<<<<<<< HEAD
104-
if aac["title"] == "test title" and aac["album"] == "foolol" and
105-
ts_with_meta["title"] == "test title" and ts_with_meta["album"] == "foolol" then
106-
=======
10783

10884
if
10985

@@ -127,25 +103,24 @@ def check_done() =
127103
and
128104
ts_with_meta["album"] == "foolol"
129105
then
130-
>>>>>>> 118cc1bad (Enable id3v2 tags in HLS for all encoders. (#3604))
131106
test.pass()
132107
end
133108
end
134109
end
135110

136111
aac = input.hls("#{tmp_dir}/aac.m3u8")
137-
138-
aac = source.on_metadata(aac, fun (m) -> begin
139-
if m["title"] != "" then
140-
to_check := to_check().{ aac = m }
141-
end
142-
check_done()
143-
end)
112+
aac =
113+
source.on_metadata(
114+
aac,
115+
fun (m) ->
116+
begin
117+
if m["title"] != "" then to_check := to_check().{aac=m} end
118+
check_done()
119+
end
120+
)
144121

145122
output.dummy(fallible=true, aac)
146123

147-
<<<<<<< HEAD
148-
=======
149124
#< FFMPEG seems to be unable to parse id3v2 metadata
150125
inside mp3 streams..
151126
shine = input.hls("#{tmp_dir}/shine.m3u8")
@@ -188,42 +163,40 @@ fdkaac =
188163

189164
output.dummy(fallible=true, fdkaac)
190165

191-
>>>>>>> 118cc1bad (Enable id3v2 tags in HLS for all encoders. (#3604))
192166
ts_with_meta = input.hls("#{tmp_dir}/ts_with_meta.m3u8")
193-
194-
ts_with_meta = source.on_metadata(ts_with_meta, fun (m) -> begin
195-
if m["title"] != "" then
196-
to_check := to_check().{ ts_with_meta = m }
197-
end
198-
check_done()
199-
end)
167+
ts_with_meta =
168+
source.on_metadata(
169+
ts_with_meta,
170+
fun (m) ->
171+
begin
172+
if m["title"] != "" then to_check := to_check().{ts_with_meta=m} end
173+
check_done()
174+
end
175+
)
200176

201177
output.dummy(fallible=true, ts_with_meta)
202-
203178
ts = input.hls("#{tmp_dir}/ts.m3u8")
204-
205-
ts = source.on_metadata(ts, fun (m) -> begin
206-
if m["title"] != "" then
207-
to_check := to_check().{ ts = m }
208-
end
209-
check_done()
210-
end)
179+
ts =
180+
source.on_metadata(
181+
ts,
182+
fun (m) ->
183+
begin
184+
if m["title"] != "" then to_check := to_check().{ts=m} end
185+
check_done()
186+
end
187+
)
211188

212189
output.dummy(fallible=true, ts)
213-
214190
mp4 = input.hls("#{tmp_dir}/mp4.m3u8")
215-
216-
mp4 = source.on_metadata(mp4, fun (m) -> begin
217-
if m["title"] != "" then
218-
to_check := to_check().{ mp4 = m }
219-
end
220-
check_done()
221-
end)
191+
mp4 =
192+
source.on_metadata(
193+
mp4,
194+
fun (m) ->
195+
begin
196+
if m["title"] != "" then to_check := to_check().{mp4=m} end
197+
check_done()
198+
end
199+
)
222200

223201
output.dummy(fallible=true, mp4)
224-
<<<<<<< HEAD
225-
226-
clock.assign_new(sync="none",[s, aac, ts_with_meta, ts, mp4])
227-
=======
228202
clock.assign_new(sync="none", [s, aac, fdkaac, ts_with_meta, ts, mp4])
229-
>>>>>>> 118cc1bad (Enable id3v2 tags in HLS for all encoders. (#3604))

0 commit comments

Comments
 (0)