diff options
author | Oliver Freyermuth <o.freyermuth@googlemail.com> | 2014-12-31 02:20:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-06 19:52:27 +0100 |
commit | 7fe5d8c78e32bd7f609d410c3b769060630553fb (patch) | |
tree | 64aba89e31d3ce21cf4308d1508e6aff25fe88b5 /stream/stream_dvb.c | |
parent | 0c42484d8e7b064b69d92f209cf2cb082f756b97 (diff) | |
download | mpv-7fe5d8c78e32bd7f609d410c3b769060630553fb.tar.bz2 mpv-7fe5d8c78e32bd7f609d410c3b769060630553fb.tar.xz |
dvb: Extend understanding of VDR channel config: stream_id, inversion.
Now also "stream ID" (for DVB-S2) and "inversion" are understood.
The parameter-string can also provide information on FEC, rolloff etc. For DVB-S, "auto" which mpv uses by default should be fine, I can also confirm it works. For non-DVB-S cards, it might be useful to also parse this information in case of a vdr-channel list.
As I have no such hardware and thus would have to do it blindly, I added a FIXME.
Mostly complete vdr-channels.conf format documentation is at http://www.vdr-wiki.de/wiki/index.php/Channels.conf (german only).
Diffstat (limited to 'stream/stream_dvb.c')
-rw-r--r-- | stream/stream_dvb.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index d20d8463fd..08491beed5 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -89,6 +89,8 @@ const struct m_sub_options stream_dvb_conf = { }; static void parse_vdr_par_string(const char* vdr_par_str, dvb_channel_t* ptr) { + //FIXME: There is more information in this parameter string, especially related + // to non-DVB-S reception. if (vdr_par_str[0]) { const char* vdr_par = &vdr_par_str[0]; while (vdr_par && *vdr_par) { @@ -110,6 +112,25 @@ static void parse_vdr_par_string(const char* vdr_par_str, dvb_channel_t* ptr) { } vdr_par++; break; + case 'P': + vdr_par++; + char *endptr = NULL; + errno = 0; + int n = strtol(vdr_par, &endptr, 10); + if (!errno && endptr != vdr_par) { + ptr->stream_id = n; + vdr_par = endptr; + } + break; + case 'I': + vdr_par++; + if (*vdr_par == '1') { + ptr->inv = INVERSION_ON; + } else { + ptr->inv = INVERSION_OFF; + } + vdr_par++; + break; default: vdr_par++; } @@ -187,6 +208,8 @@ static dvb_channels_list *dvb_get_channels(struct mp_log *log, char *filename, i ptr->pids_cnt = 0; ptr->freq = 0; ptr->is_dvb_s2 = false; + ptr->stream_id = NO_STREAM_ID_FILTER; + ptr->inv = INVERSION_AUTO; // Check if VDR-type channels.conf-line - then full line is consumed by the scan. int num_chars = 0; @@ -203,8 +226,8 @@ static dvb_channels_list *dvb_get_channels(struct mp_log *log, char *filename, i ptr->tone = -1; ptr->inv = INVERSION_AUTO; ptr->cr = FEC_AUTO; - mp_verbose(log, "SAT, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, S2: %s", - list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->is_dvb_s2 ? "yes" : "no"); + mp_verbose(log, "SAT, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, S2: %s, StreamID: %d", + list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->is_dvb_s2 ? "yes" : "no", ptr->stream_id); } else { mp_verbose(log, "VDR, NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d", list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate); @@ -567,7 +590,8 @@ int dvb_set_channel(stream_t *stream, int card, int n) if(channel->freq != priv->last_freq) if (! dvb_tune(priv, channel->freq, channel->pol, channel->srate, channel->diseqc, channel->tone, - channel->is_dvb_s2, channel->inv, channel->mod, channel->gi, channel->trans, channel->bw, channel->cr, channel->cr_lp, channel->hier, priv->cfg_timeout)) + channel->is_dvb_s2, channel->stream_id, channel->inv, channel->mod, channel->gi, + channel->trans, channel->bw, channel->cr, channel->cr_lp, channel->hier, priv->cfg_timeout)) return 0; priv->last_freq = channel->freq; |