avformat/utils: fix mixed declarations and code