dvbbasebin: fix parsing of freqs in some ZAP files

Change avoids attempting to convert to kHz if unneeded.

There are quite some ZAP format variants out there. Among
their subtle little differences, some store transponder
frequencies in Mhz and others in kHz. The latter been the
most common variant.
This commit is contained in:
Reynaldo H. Verdejo Pinochet 2014-08-11 21:25:41 -04:00
parent d314a3a591
commit 17181bfe16

View file

@ -96,8 +96,17 @@ parse_channels_conf_from_file (GstElement * dvbbasebin, const gchar * filename,
g_hash_table_insert (params, g_strdup (satellite[j - 2]),
g_strdup (fields[j]));
}
g_hash_table_insert (params, g_strdup ("frequency"),
g_strdup_printf ("%d", atoi (fields[1]) * 1000));
/**
* Some ZAP format variations store freqs in MHz
* but we internally use kHz for DVB-S/S2.
*/
if (strlen (fields[1]) < 6) {
g_hash_table_insert (params, g_strdup ("frequency"),
g_strdup_printf ("%d", atoi (fields[1]) * 1000));
} else {
g_hash_table_insert (params, g_strdup ("frequency"),
g_strdup_printf ("%d", atoi (fields[1])));
}
parsed = TRUE;
} else if (numfields == 13) {
/* terrestrial */