+ nbytes = (uint16_t) (STARTING_LOG_OFFSET + sizeof (uint16_t) * n_samples);
+
+ /*
+ * Rewrite n_samples so that it includes the log ID value with
+ * 32-bit n_samples split into two chunks
+ */
+ if (sizeof (n_samples) > 2) {
+ N_SAMPLES_TYPE n_samples_low;
+ N_SAMPLES_TYPE n_samples_high;
+ n_samples_low = n_samples & ((1 << AO_LOG_ID_SHIFT) - 1);
+ n_samples_high = (n_samples - n_samples_low) << AO_LOG_ID_WIDTH;
+ n_samples = n_samples_low | n_samples_high;
+ }