mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
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:
parent
d314a3a591
commit
17181bfe16
1 changed files with 11 additions and 2 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue