Added more safe video and audio buffer processing

* Checking writer's status before appending buffer