Commit 30635669 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: update discontinuity flag

 - Set the flag when the buffer is marked.
 - Set the flag (for next buffer) when the buffer is dropped.
 - Clear the flag when a buffer is played.
parent f72132f1
...@@ -406,6 +406,8 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate) ...@@ -406,6 +406,8 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate)
msg_Err (aout, "buffer too early (%"PRId64" us): dropped", advance); msg_Err (aout, "buffer too early (%"PRId64" us): dropped", advance);
goto drop; goto drop;
} }
if (block->i_flags & BLOCK_FLAG_DISCONTINUITY)
owner->sync.discontinuity = true;
block = aout_FiltersPlay (aout, block, input_rate); block = aout_FiltersPlay (aout, block, input_rate);
if (block == NULL) if (block == NULL)
...@@ -419,11 +421,13 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate) ...@@ -419,11 +421,13 @@ int aout_DecPlay (audio_output_t *aout, block_t *block, int input_rate)
/* Output */ /* Output */
owner->sync.end = block->i_pts + block->i_length + 1; owner->sync.end = block->i_pts + block->i_length + 1;
owner->sync.discontinuity = false;
aout_OutputPlay (aout, block); aout_OutputPlay (aout, block);
out: out:
aout_unlock (aout); aout_unlock (aout);
return 0; return 0;
drop: drop:
owner->sync.discontinuity = true;
block_Release (block); block_Release (block);
lost: lost:
atomic_fetch_add(&owner->buffers_lost, 1); atomic_fetch_add(&owner->buffers_lost, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment