This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: libdvbv5/dvb-scan: flush any pending bufs after dvb_dmx_stop
Author:  Hans Verkuil <[email protected]>
Date:    Wed Jun 4 10:38:35 2025 +0200

After dvb_dmx_stop() is called, and we are using streaming I/O, then
flush any pending buffers. If we don't do that, then those buffers
will be dequeued next time we enter dvb_read_sections.

If you are not using streaming I/O, then this isn't needed since
the kernel will clear all pending data from the read() buffer when
DMX_STOP is called. But for streaming I/O those buffers are already
queued up for the application.

Signed-off-by: Hans Verkuil <[email protected]>
Acked-by: Mauro Carvalho Chehab <[email protected]>

 lib/libdvbv5/dvb-scan.c | 9 +++++++++
 1 file changed, 9 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=049e7c483ea7c11c51bf4aaf37d7924913bf041d
diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index afe3a4f02bb6..f07b130650fb 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -427,6 +427,15 @@ int dvb_read_sections(struct dvb_v5_fe_parms *__p, int 
dmx_fd,
        }
        dvb_dmx_stop(dmx_fd);
        dvb_table_filter_free(sect);
+       if (parms->p.stream_ctx) {
+               /* Flush pending buffers */
+               while (dvb_poll(parms, dmx_fd, 0) > 0) {
+                       struct dmx_buffer b;
+                       if (dvb_v5_stream_dqbuf(parms->p.stream_ctx, &b) >= 0) {
+                               dvb_v5_stream_qbuf(parms->p.stream_ctx, 
b.index);
+                       }
+               }
+       }
 
        if (ret > 0)
                ret = 0;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to