1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

Detect and report TS misalignment and switch to unaligned processing.

This commit is contained in:
none 2021-02-25 14:58:42 +01:00
parent 28e09191af
commit 01ca1b8805
2 changed files with 21 additions and 5 deletions

View File

@ -2300,14 +2300,29 @@ static void input_write_dvb(struct ddb_input *input,
if (alt_dma)
dma_sync_single_for_cpu(dev->dev, dma2->pbuf[dma->cbuf],
dma2->size, DMA_FROM_DEVICE);
if (raw_stream || input->con)
if (raw_stream || input->con) {
dvb_dmx_swfilter_raw(&dvb->demux,
dma2->vbuf[dma->cbuf],
dma2->size);
else
dvb_dmx_swfilter_packets(&dvb->demux,
} else {
if (dma2->vbuf[dma->cbuf][0] != 0x47) {
if (!dma2->unaligned) {
dma2->unaligned++;
dev_warn(dev->dev, "Input %u dma buffer unaligned, "
"switching to unaligned processing.\n",
input->nr);
print_hex_dump(KERN_INFO, "TS: ", DUMP_PREFIX_OFFSET, 32, 1,
dma2->vbuf[dma->cbuf],
256, false);
}
dvb_dmx_swfilter(&dvb->demux,
dma2->vbuf[dma->cbuf],
dma2->size / 188);
dma2->size);
} else
dvb_dmx_swfilter_packets(&dvb->demux,
dma2->vbuf[dma->cbuf],
dma2->size / 188);
}
dma->cbuf = (dma->cbuf + 1) % dma2->num;
if (ack)

View File

@ -219,6 +219,7 @@ struct ddb_dma {
u32 stall_count;
u32 packet_loss;
u32 unaligned;
};
struct ddb_dvb {