24 Apr
2014
24 Apr
'14
11:02 p.m.
When forwarding or rewinding, the frame counter was not updated. This could result in corrupted channel status words or misplaced Z-type preamble.
Do you mean it is the responsibility for a52 and dca plugin to return the SAFE value returned by snd_pcm_rewindable and snd_pcm_forwardable since they enocde the audio and padding zeros and write to IEC958 ?
+static snd_pcm_sframes_t snd_pcm_iec958_rewind(snd_pcm_t *pcm,
snd_pcm_uframes_t frames)
+{
unsigned int counter_decrement;
snd_pcm_iec958_t *iec = pcm->private_data;
snd_pcm_sframes_t result = snd_pcm_plugin_rewind(pcm, frames);
if (result <= 0)
return result;
counter_decrement = result % 192;
iec->counter += 192 - counter_decrement;
iec->counter %= 192;
return result;
+}
+static snd_pcm_sframes_t snd_pcm_iec958_forward(snd_pcm_t *pcm,
snd_pcm_uframes_t frames)
+{
unsigned int counter_increment;
snd_pcm_iec958_t *iec = pcm->private_data;
snd_pcm_sframes_t result = snd_pcm_plugin_rewind(pcm, frames);
if (result <= 0)
return result;
counter_increment = result % 192;
iec->counter += counter_increment;
iec->counter %= 192;
return result;
+}