pthread_frame: use av_buffer_replace() to simplify code