PCM packetizer: refactor size/sample conversion routines; use const &
PCM packetizer: calculate duration for packets from packaged sources

Fixes #1075.