Sync with current ffmpeg CVS and minor clean up