pthread_frame: use the AVFrame API properly.