avformat/hlsenc: correctly compute target duration