mpegts_mux_dvb: fix the dvb-s position parsing

This commit is contained in:
Jaroslav Kysela 2014-06-12 22:48:26 +02:00
parent 58b6bd8e3c
commit 65aad9ba55

View file

@ -436,8 +436,13 @@ dvb_mux_dvbs_class_orbital_set ( void *o, const void *s )
const char *tmp = s;
dvb_mux_t *lm = o;
/* Note that 'E' is not passed to dir from sscanf (scientific float format) */
if ((n = sscanf(tmp, "%f%c", &posf, &dir)) < 1) return 0;
if (n != 2) dir = 0;
if (n != 2) {
dir = tmp[0] != '\0' ? tmp[strlen(tmp)-1] : 0;
if (dir != 'E' && dir != 'W')
dir = 0;
}
pos = (int)floorf(posf * 10.0);
if (pos != lm->lm_tuning.u.dmc_fe_qpsk.orbital_pos ||