AprilAndFriends / theoraplayer

A multi-threaded C++ library that plays video files supporting multiple codecs across platforms. Easy to use, fast, responsive, abstract interface and minimal dependencies, you'll soon be wondering how you lived without it! ;) Audio and Video interfaces are completely abstracted so the library can be used anywhere, regardless of what you use to display video frames and play audio samples (eg. OpenGL / OpenAL, Direct3D / DirectSound?, SDL / SDL_mixer, X11 / alsa ...) The library can pre-cache video frames and decoded audio samples for maximum efficiency and smooth playback, even on single-cpu systems. Currently, the library supports Theora on Windows, Mac, iOS, Linux, Android, WinRT and Windows Phone. H.264 is supported on Mac and iOS.
BSD 3-Clause "New" or "Revised" License
84 stars 43 forks source link

[MemoryDataSource] Add optional 'deleteData' parameter to constructor to allow management of 'data' parameter lifespan outside of libtheoraplayer #29

Closed jleveque closed 6 years ago

jleveque commented 6 years ago

Allow more flexibility for managing lifespan of data parameter outside of libtheoraplayer.

This is helpful in the following situations:

The new deleteData parameter defaults to true so as not to have an impact on any internal theoraplayer source code. It must be explicitly set to false when calling the constructor.

kspes commented 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:

jleveque commented 6 years ago

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).

kspes commented 6 years ago

all is good now, merged! Thanks for your contribution :)