diff mbox series

[7/9] libdvbv5/dvb-scan: always requeue after dvb_parse_section

Message ID d3680ee831a6638ca9f264966d4fccf6f2078df1.1749121112.git.hverkuil@xs4all.nl
State New
Headers show
Series [1/9] dvbv5: streaming support using videobuf2 for DVR and auto-scan | expand

Commit Message

Hans Verkuil June 5, 2025, 10:58 a.m. UTC
Even if dvb_parse_section returns non-zero, you still need to requeue the buffer.
Otherwise it will effectively be lost.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
---
 lib/libdvbv5/dvb-scan.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c
index 3f52d140..afe3a4f0 100644
--- a/lib/libdvbv5/dvb-scan.c
+++ b/lib/libdvbv5/dvb-scan.c
@@ -412,14 +412,12 @@  int dvb_read_sections(struct dvb_v5_fe_parms *__p, int dmx_fd,
 		ret = dvb_parse_section(parms, sect, buf, buf_length);
 
 		if (parms->p.stream_ctx) {
-			/**enqueue the buffer again*/
-			if (!ret) {
-				if (dvb_v5_stream_qbuf(parms->p.stream_ctx, b.index) < 0) {
-					parms->p.stream_ctx->error = 1;
-					break;
-				} else {
-					parms->p.stream_ctx->buf_flag[b.index] = 1;
-				}
+			/* enqueue the buffer again */
+			if (dvb_v5_stream_qbuf(parms->p.stream_ctx, b.index) < 0) {
+				parms->p.stream_ctx->error = 1;
+				break;
+			} else {
+				parms->p.stream_ctx->buf_flag[b.index] = 1;
 			}
 		}
 	} while (!ret);