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-file: better handle format differences
Author:  Mauro Carvalho Chehab <[email protected]>
Date:    Sat Apr 11 12:54:25 2026 +0200

Legacy formats may not have all values for DVB-S2 and newer
standards. Better handle errors during format conversion by
replacing invalid values with AUTO, while still reporting
warnings.

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

 lib/libdvbv5/dvb-file.c | 46 ++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 42 insertions(+), 4 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=8aa593bda182961ae4586cf7ec8d6d3fe387cb92
diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index 09d071dab694..a5de2ca6f9e3 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -504,12 +504,50 @@ int dvb_write_format_oneline(const char *fname,
                                                data = BANDWIDTH_AUTO;
                                }
                                if (data >= table->size) {
+                                       char *data_name;
+                                       const char * const *attr_name = 
dvb_v5_attr_names[table->prop];
+                                       int warn = 0;
+
+                                       if (attr_name)
+                                               data_name = (char 
*)attr_name[data];
+                                       else
+                                               asprintf(&data_name, "%ui", 
data);
+
                                        sprintf(err_msg,
-                                                _("value not supported"));
-                                       goto error;
-                               }
+                                                _("%s doesn't support %s on 
this format"),
+                                               dvb_v5_name[table->prop],
+                                               data_name);
+
+                                       if (!attr_name)
+                                               free(data_name);
+
+                                       switch (table->prop) {
+                                       case DTV_MODULATION:
+                                               data_name = "QAM/AUTO";
+                                               warn = 1;
+                                               break;
+                                       case DTV_INNER_FEC:
+                                       case DTV_TRANSMISSION_MODE:
+                                       case DTV_GUARD_INTERVAL:
+                                       case DTV_HIERARCHY:
+                                       case DTV_INVERSION:
+                                       case DTV_PILOT:
+                                       case DTV_ROLLOFF:
+                                               data_name = "AUTO";
+                                               warn = 1;
+                                               break;
+                                       }
 
-                               fprintf(fp, "%s", table->table[data]);
+                                       if (!warn)
+                                               goto error;
+
+                                       fprintf(stderr, _("WARNING: %s while 
parsing entry %d of %s\n"),
+                                               err_msg, line, fname);
+
+                                       fprintf(fp, "%s", data_name);
+                               } else {
+                                       fprintf(fp, "%s", table->table[data]);
+                               }
                        } else {
                                switch (table->prop) {
                                case DTV_VIDEO_PID:
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to