shouldn't this be boost:scoped_ptr<transcoder> tr instead of a plain pointer ? where is the transcoder deallocation ?