demux/ttml: generation of style-attribute contains (null) if dest is empty
testcase
<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/ns/ttml" xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
xmlns:tts="http://www.w3.org/ns/ttml#styling" xmlns:ebuttm="urn:ebu:tt:metadata"
ttp:timeBase="media" xml:lang="en" ttp:cellResolution="50 30">
<head>
<styling></styling>
<layout></layout>
</head>
<body>
<div style="paragraphStyle">
<p xml:id="subtitle1" region="bottom" begin="00:00:00.000" end="00:00:20.000">
<span style="spanStyle">One <br/>line Subtitle.</span>
</p>
</div>
</body>
</tt>
gdb session
(gdb) break substtml.c:DecodeBlock
No source file named substtml.c.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (substtml.c:DecodeBlock) pending.
Thread 20 "vlc-static" hit Breakpoint 1, DecodeBlock (p_dec=0x7fffb591ede8, pp_block=0x7fff9b472e28) at /home/refp/work/videolan/vlc/git/modules/codec/substtml.c:809
809 {
(gdb) p/s (*pp_block)->p_buffer
$1 = (uint8_t *) 0x7fffb9b0fd00 "<tt ttp:cellResolution=\"50 30\" xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\" xml:lang=\"en\" ttp:timeBase=\"media\" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\" xmlns=\"http://www.w3.org/ns/ttml\" xmlns:ebuttm=\"urn:ebu:tt:metadata\"><p region=\"bottom\" xml:id=\"subtitle1\" style=\"paragraphStyle (null)\"><span style=\"spanStyle\">One <br/>line Subtitle. </span></p></tt>"
Elaboration
The <p>
sent from the demuxer to the decoder should have style="paragraphStyle"
as an attribute given that its ancestor has this specified, but instead the sent data includes style="paragraphStyle (null)"
.
Edited by Filip Roséen