PredictableLoading

From Gnash Project Wiki

Jump to: navigation, search

< bwy> We'll have to implement predictable loading to fix those properly.

< bwy> I have an idea how to do it fairly easily, but no time.

< gg0> well share the idea, maybe bjacques or strk have that time

< bwy> The only thing that's easier about it is that much of it could be done using sed.

< bwy> You would convert the parsing code to a push parser first, which would involve changing the SWFStream& argument to an iterator_range and using free functions to read from it.

< bjacques> what to do about ensureBytes?

< bwy> That wouldn't be a problem with a push parser, because you'd make sure the whole tag was available before parsing it.

< bwy> There are still the problems of bit reading and image data parsing though.

< bjacques> sounds good

< bjacques> how so?

< bwy> The former would require some kind of extra class to keep track of the bits read (like libbase/BitsReader)

< bwy> It's not hard, but also not easy using find and replace.

< bwy> The latter needs a rewrite of much of the image reading code, which would improve it but needs time.

< bjacques> I think the push parsing model is necessary anyway for the plugin migration

< bjacques> it is theoretically possible to avoid it but it would be a big mess