diff options
author | wm4 <wm4@nowhere> | 2016-09-09 17:36:01 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-09-09 17:54:35 +0200 |
commit | 5324fb731f6ea866e9804c659417c231157d4d75 (patch) | |
tree | 930dca8574f5a3705e76e12c42eb0f73b01dc224 /demux | |
parent | 9213db0d492de3ca94a92116aec969597642d83e (diff) | |
download | mpv-5324fb731f6ea866e9804c659417c231157d4d75.tar.bz2 mpv-5324fb731f6ea866e9804c659417c231157d4d75.tar.xz |
tv: remove weird option parsing stuff
Mostly untested.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_tv.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/demux/demux_tv.c b/demux/demux_tv.c index 005a693732..d80693e465 100644 --- a/demux/demux_tv.c +++ b/demux/demux_tv.c @@ -27,13 +27,21 @@ static int demux_open_tv(demuxer_t *demuxer, enum demux_check check) tv_param_t *params = mp_get_config_group(demuxer, demuxer->global, &tv_params_conf); - struct tv_stream_params *sparams = demuxer->stream->priv; - if (sparams->channel && sparams->channel[0]) { - talloc_free(params->channel); - params->channel = talloc_strdup(NULL, sparams->channel); + bstr urlparams = bstr0(demuxer->stream->path); + bstr channel, input; + bstr_split_tok(urlparams, "/", &channel, &input); + if (channel.len) { + talloc_free(params->channels); + params->channel = bstrto0(NULL, channel); + } + if (input.len) { + bstr r; + params->input = bstrtoll(input, &r, 0); + if (r.len) { + MP_ERR(demuxer->stream, "invalid input: '%.*s'\n", BSTR_P(input)); + return -1; + } } - if (sparams->input >= 0) - params->input = sparams->input; assert(demuxer->priv==NULL); if(!(tvh=tv_begin(params, demuxer->log))) return -1; |