Commit 3c984e7a authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

demux/playlist/dvb: simplify parsing

the variable named str is not referred to after the lines in question,
as such this simplifies the implementation after the recent changes to
ParseFEC, ParseModulation, and ParseGuard.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 6f3de35b
......@@ -251,10 +251,8 @@ static input_item_t *ParseLine(char *line)
if (*end)
return NULL;
str = strsep(&line, ":");
const char *fec = ParseFEC(str);
str = strsep(&line, ":");
const char *mod = ParseModulation(str);
const char *fec = ParseFEC(strsep(&line, ":"));
const char *mod = ParseModulation(strsep(&line,":"));
if (fec == NULL || mod == NULL)
return NULL;
......@@ -267,12 +265,10 @@ static input_item_t *ParseLine(char *line)
{ /* DVB-T */
unsigned bandwidth = atoi(str + 10);
str = strsep(&line, ":");
const char *hp = ParseFEC(str);
str = strsep(&line, ":");
const char *lp = ParseFEC(str);
str = strsep(&line, ":");
const char *mod = ParseModulation(str);
const char *hp = ParseFEC(strsep(&line, ":"));
const char *lp = ParseFEC(strsep(&line, ":"));
const char *mod = ParseModulation(strsep(&line, ":"));
if (hp == NULL || lp == NULL || mod == NULL)
return NULL;
......@@ -283,8 +279,7 @@ static input_item_t *ParseLine(char *line)
if (xmit == 0)
xmit = -1; /* AUTO */
str = strsep(&line, ":");
const char *guard = ParseGuard(str);
const char *guard = ParseGuard(strsep(&line,":"));
if (guard == NULL)
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment