aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/firewire/amdtp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c
index 09f70ee4d04a..046007ddbcae 100644
--- a/sound/firewire/amdtp.c
+++ b/sound/firewire/amdtp.c
@@ -228,11 +228,15 @@ static unsigned int calculate_syt(struct amdtp_out_stream *s,
228 syt_offset = s->last_syt_offset - TICKS_PER_CYCLE; 228 syt_offset = s->last_syt_offset - TICKS_PER_CYCLE;
229 s->last_syt_offset = syt_offset; 229 s->last_syt_offset = syt_offset;
230 230
231 syt_offset += TRANSFER_DELAY_TICKS - TICKS_PER_CYCLE; 231 if (syt_offset < TICKS_PER_CYCLE) {
232 syt = (cycle + syt_offset / TICKS_PER_CYCLE) << 12; 232 syt_offset += TRANSFER_DELAY_TICKS - TICKS_PER_CYCLE;
233 syt += syt_offset % TICKS_PER_CYCLE; 233 syt = (cycle + syt_offset / TICKS_PER_CYCLE) << 12;
234 syt += syt_offset % TICKS_PER_CYCLE;
234 235
235 return syt & 0xffff; 236 return syt & 0xffff;
237 } else {
238 return 0xffff; /* no info */
239 }
236} 240}
237 241
238static void amdtp_write_s32(struct amdtp_out_stream *s, 242static void amdtp_write_s32(struct amdtp_out_stream *s,