avformat/utils: fix calculating the absolute difference of timestamps