use another method to flush buffer when seeking

Switching to another function which the official documentation of ffmpeg says
"should be called when seeking".