Mercurial > mplayer.hg
changeset 36507:faf406e38545
vo_bl: Simplify parser, reduce code duplication.
author | reimar |
---|---|
date | Sat, 18 Jan 2014 13:36:37 +0000 |
parents | 0f2c90b69a12 |
children | 449868d26489 |
files | libvo/vo_bl.c |
diffstat | 1 files changed, 8 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/vo_bl.c Sat Jan 18 13:14:54 2014 +0000 +++ b/libvo/vo_bl.c Sat Jan 18 13:36:37 2014 +0000 @@ -398,7 +398,7 @@ mp_msg(MSGT_VO, MSGL_ERR, "bl: maximum number of files reached (%d)\n", BL_MAX_FILES); return 1; } - p += 5; + p = q; q += strcspn(q, ","); if (*q == '\0') end = 1; *q = '\0'; @@ -411,21 +411,19 @@ mp_msg(MSGT_VO, MSGL_ERR, "bl: maximum number of hosts reached (%d)\n", BL_MAX_HOSTS); return 1; } - p += 5; + p = q; q += strcspn(q, ",:"); + + bl_hosts[no_bl_hosts].port = 2323; // default port if (*q == ':') { *q++ = '\0'; - bl_hosts[no_bl_hosts].name = p; bl_hosts[no_bl_hosts].port = atoi(q); q += strcspn(q, ","); - if (*q == '\0') end = 1; - } else { - /* use default port */ - if (*q == '\0') end = 1; - *q = '\0'; - bl_hosts[no_bl_hosts].name = p; - bl_hosts[no_bl_hosts].port = 2323; } + + if (*q == '\0') end = 1; + *q = '\0'; + bl_hosts[no_bl_hosts].name = p; mp_msg(MSGT_VO, MSGL_V, "blhost[%d]: %s:%d\n", no_bl_hosts, p,