Fix a bug of reading media.