refine the ffmepg_media.c, fixed the segment fault and fixed the logical of media type judgement

fixed segment fault and logical error