fix copilation and add support for Extmedia

Thanks cm