GNOME Bugzilla – Bug 775965
ttmlparse: Collect buffers until detecting complete xml document
Last modified: 2018-11-03 14:01:38 UTC
Pushed buffer from upstream element might be fragmented
Created attachment 341788 [details] [review] ttmlparse: Collect buffers until detecting complete xml document
Created attachment 341789 [details] [review] ttmlrender: Fix segfault on _render_text_region() Fix invalid memory access
Problem can be reproduced with gst-play-1.0 http://dash.akamaized.net/dash264/TestCases/4b/qualcomm/3/Solekai.mpd
Review of attachment 341788 [details] [review]: ::: ext/ttml/gstttmlparse.c @@ +438,3 @@ + G_GSIZE_FORMAT, avail); + return; + } Instead of trying to parse the document every time (which is expensive), it would be better to just check the starting and closing XML tag. Especially that would then also work if you get *multiple* documents in a single buffer (in which case you would have to split).
Comment on attachment 341789 [details] [review] ttmlrender: Fix segfault on _render_text_region() Attachment 341789 [details] pushed as a5ce16f - ttmlrender: Fix segfault on _render_text_region()
(In reply to Sebastian Dröge (slomo) from comment #4) > Review of attachment 341788 [details] [review] [review]: What do you think about converting baseclass of ttmlparse to baseparse?, is it too bulky? (currently just gstelement is used)
Is that going to make anything easier? In general, sure... but I'm not sure how well baseparse fits for how ttmlparse works.
(In reply to Sebastian Dröge (slomo) from comment #7) > Is that going to make anything easier? In general, sure... but I'm not sure > how well baseparse fits for how ttmlparse works. converting baseclass to baseparse seems to be reasonable to me. - Because nobody guarantee that input buffers are complete xml document, make use of basepasrse's buffer gathering logic can make the code simple, I think. - One feature of ttml is xml document can be demuxed (?) into multiple buffer, but it also be covered by baseparse's API. - One left tricky thing is setting PTS on buffer based on input buffer's PTS and duration, but it's a challenge for both current ttmlparse based and baseparse based. I'll take a look at the structure more.
Created attachment 373106 [details] [review] ttmlparse: Collect buffers until detecting complete xml document Given buffer could be fragmented and we might need to collect buffers until end tag is detected. And/or, a buffer can consist of multiple ttml documents.
(In reply to Sebastian Dröge (slomo) from comment #7) > Is that going to make anything easier? In general, sure... but I'm not sure > how well baseparse fits for how ttmlparse works. I found that subparse also just gstelement based (not baseparse based). So I changed my mind :)
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/494.