Fix some memory and FFMpeg issues
Conditional debug message
Fix compilation with older FFMpeg versions
Merge pull request #34 from phantom10111/master

Memory and FFMpeg fixes