Closed jleveque closed 6 years ago
I agree, it makes perfect sense, can't believe I didn't think of this case :)
Just adjust the code to match the library convention:
Done. I made sure the line I added was indented with tabs to be consistent with your style, and I also fixed line 27 of the cpp file which was already incorrect in the process, but I missed line 21 which was also already incorrect.
With this new commit, I replaced all remaining 4-space indentations in these files with tabs (8 additional lines).
all is good now, merged! Thanks for your contribution :)
Allow more flexibility for managing lifespan of
data
parameter outside of libtheoraplayer.This is helpful in the following situations:
data
needs to live longer than the MemoryDataSource created from it.data
was allocated using amalloc
family function.data
is freed usingdelete[]
, which assumes it was allocated usingnew[]
. This creates a mismatch if thedata
parameter was allocated using a function from themalloc
family.The new
deleteData
parameter defaults totrue
so as not to have an impact on any internal theoraplayer source code. It must be explicitly set tofalse
when calling the constructor.