pthread_frame: simplify the code by using new AVPacket API