Fixed bugs in mediatimer.py.

Signed-off-by: Xiaomao Chen <xiaomao5@live.com>