Commit 28473a19 authored by Daniel Scheller's avatar Daniel Scheller Committed by Mauro Carvalho Chehab

media: ddbridge: fix output buffer check

A 188 byte gap has to be left between the writer and the consumer. This
requires 2*188 bytes available to be able to write to the output buffers.
So, change ddb_output_free() to report free bytes according to this rule.

Picked up from the upstream dddvb-0.9.33 release.
Signed-off-by: default avatarDaniel Scheller <d.scheller@gmx.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent e415eec4
...@@ -572,12 +572,12 @@ static u32 ddb_output_free(struct ddb_output *output) ...@@ -572,12 +572,12 @@ static u32 ddb_output_free(struct ddb_output *output)
if (output->dma->cbuf != idx) { if (output->dma->cbuf != idx) {
if ((((output->dma->cbuf + 1) % output->dma->num) == idx) && if ((((output->dma->cbuf + 1) % output->dma->num) == idx) &&
(output->dma->size - output->dma->coff <= 188)) (output->dma->size - output->dma->coff <= (2 * 188)))
return 0; return 0;
return 188; return 188;
} }
diff = off - output->dma->coff; diff = off - output->dma->coff;
if (diff <= 0 || diff > 188) if (diff <= 0 || diff > (2 * 188))
return 188; return 188;
return 0; return 0;
} }
......
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