Fix A/V sync error accumulation regression in avformat producer.

Regresion occurred in commit 6cfe84 on March 18 when adding support for
libavformat v55.
Fix A/V sync error accumulation in avformat consumer.

This appears to be a long-standing problem: we were not correctly
setting the number of audio samples per frame.