This patch add parsing support for the POLARIZATION parameter for the DVBv5 
file format.

Signed-off-by: Guy Martin <gms...@tuxicoman.be>

diff --git a/lib/include/dvb-file.h b/lib/include/dvb-file.h
index ea76080..2259844 100644
--- a/lib/include/dvb-file.h
+++ b/lib/include/dvb-file.h
@@ -35,7 +35,7 @@ struct dvb_entry {
 
        char *location;
 
-//     enum dvbsat_polarization pol;
+       enum dvb_sat_polarization pol;
        int sat_number;
        unsigned freq_bpf;
        unsigned diseqc_wait;
diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index aa42a37..3ea40cc 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -428,16 +428,15 @@ static int fill_entry(struct dvb_entry *entry, char *key, 
char *value)
                is_video = 1;
        else if (!strcasecmp(key, "AUDIO_PID"))
                is_audio = 1;
-       /*else if (!strcasecmp(key, "POLARIZATION")) {
-               entry->service_id = atol(value);
-               for (j = 0; ARRAY_SIZE(pol_name); j++)
-                       if (!strcasecmp(value, pol_name[j]))
+       else if (!strcasecmp(key, "POLARIZATION")) {
+               for (j = 0; ARRAY_SIZE(dvb_sat_pol_name); j++)
+                       if (!strcasecmp(value, dvb_sat_pol_name[j]))
                                break;
-               if (j == ARRAY_SIZE(pol_name))
+               if (j == ARRAY_SIZE(dvb_sat_pol_name))
                        return -2;
                entry->pol = j;
                return 0;
-       }*/ else if (!strncasecmp(key,"PID_", 4)){
+       } else if (!strncasecmp(key,"PID_", 4)){
                type = strtol(&key[4], NULL, 16);
                if (!type)
                        return 0;
@@ -647,10 +646,10 @@ int write_dvb_file(const char *fname, struct dvb_file 
*dvb_file)
                        fprintf(fp, "\n");
                }
 
-               /*if (entry->pol != POLARIZATION_OFF) {*/
-                       /*fprintf(fp, "\tPOLARIZATION = %s\n",*/
-                               /*pol_name[entry->pol]);*/
-               /*}*/
+               if (entry->pol != POLARIZATION_OFF) {
+                       fprintf(fp, "\tPOLARIZATION = %s\n",
+                               dvb_sat_pol_name[entry->pol]);
+               }
 
                if (entry->sat_number >= 0) {
                        fprintf(fp, "\tSAT_NUMBER = %d\n",
-- 
1.8.1.5


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to