Mercurial > mplayer.hg
comparison libmpdemux/dvbin.c @ 10708:a57e8d980652
This patch fixes:
1) if channels (in the list) are invalid excludes them
2) on encrypted/unreadable channels mplayer goes to the next/previous
3) when changing channel uninit all components but stream and input.
Nico <nsabbi@libero.it>
author | alex |
---|---|
date | Wed, 27 Aug 2003 17:08:58 +0000 |
parents | 11826d9f90c7 |
children | d8b1f7509df2 |
comparison
equal
deleted
inserted
replaced
10707:0d9ef9b4841c | 10708:a57e8d980652 |
---|---|
154 | 154 |
155 list->NUM_CHANNELS = 0; | 155 list->NUM_CHANNELS = 0; |
156 row_count = 0; | 156 row_count = 0; |
157 while(! feof(f) && row_count < 512) | 157 while(! feof(f) && row_count < 512) |
158 { | 158 { |
159 if( fgets(line, CHANNEL_LINE_LEN, f) == NULL ) continue; | 159 if( fgets(line, CHANNEL_LINE_LEN, f) == NULL ) |
160 | 160 continue; |
161 if(line[0] == '#') | 161 |
162 if((line[0] == '#') || (strlen(line) == 0)) | |
162 continue; | 163 continue; |
163 | 164 |
164 ptr = &(list->channels[list->NUM_CHANNELS]); | 165 ptr = &(list->channels[list->NUM_CHANNELS]); |
165 | 166 |
166 if(type == TUNER_TER) | 167 if(type == TUNER_TER) |
167 { | 168 { |
168 fields = sscanf(line, ter_conf, | 169 fields = sscanf(line, ter_conf, |
169 &ptr->name, &ptr->freq, &inv, &bw, &cr, &tmp_lcr, &mod, | 170 &ptr->name, &ptr->freq, &inv, &bw, &cr, &tmp_lcr, &mod, |
170 &transm, &gi, &tmp_hier, &ptr->vpid, &ptr->apid1); | 171 &transm, &gi, &tmp_hier, &ptr->vpid, &ptr->apid1); |
172 /* | |
173 mp_msg(MSGT_DEMUX, MSGL_V, | |
174 "NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, VPID: %d, APID1: %d\n", | |
175 list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->vpid, ptr->apid1); | |
176 */ | |
171 } | 177 } |
172 else if(type == TUNER_CBL) | 178 else if(type == TUNER_CBL) |
173 { | 179 { |
174 fields = sscanf(line, cbl_conf, | 180 fields = sscanf(line, cbl_conf, |
175 &ptr->name, &ptr->freq, &inv, &ptr->srate, | 181 &ptr->name, &ptr->freq, &inv, &ptr->srate, |
176 &cr, &mod, &ptr->vpid, &ptr->apid1); | 182 &cr, &mod, &ptr->vpid, &ptr->apid1); |
183 /* | |
184 mp_msg(MSGT_DEMUX, MSGL_V, | |
185 "NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, VPID: %d, APID1: %d\n", | |
186 list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->vpid, ptr->apid1); | |
187 */ | |
177 } | 188 } |
178 else //SATELLITE | 189 else //SATELLITE |
179 { | 190 { |
180 fields = sscanf(line, sat_conf, | 191 fields = sscanf(line, sat_conf, |
181 &ptr->name, &ptr->freq, &ptr->pol, &ptr->diseqc, &ptr->srate, &ptr->vpid, &ptr->apid1, | 192 &ptr->name, &ptr->freq, &ptr->pol, &ptr->diseqc, &ptr->srate, &ptr->vpid, &ptr->apid1, |
183 ptr->pol = toupper(ptr->pol); | 194 ptr->pol = toupper(ptr->pol); |
184 ptr->freq *= 1000UL; | 195 ptr->freq *= 1000UL; |
185 ptr->srate *= 1000UL; | 196 ptr->srate *= 1000UL; |
186 ptr->tone = -1; | 197 ptr->tone = -1; |
187 mp_msg(MSGT_DEMUX, MSGL_V, | 198 mp_msg(MSGT_DEMUX, MSGL_V, |
188 "NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d, TONE: %d, VPID: %d, APID1: %d, APID2: %d, TPID: %d, PROGID: %d, NUM: %d\n", | 199 "NUM: %d, NUM_FIELDS: %d, NAME: %s, FREQ: %d, SRATE: %d, POL: %c, DISEQC: %d, TONE: %d, VPID: %d, APID1: %d, APID2: %d, TPID: %d, PROGID: %d\n", |
189 fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc, ptr->tone, ptr->vpid, ptr->apid1, ptr->apid2, ptr->tpid, ptr->progid, list->NUM_CHANNELS); | 200 list->NUM_CHANNELS, fields, ptr->name, ptr->freq, ptr->srate, ptr->pol, ptr->diseqc, ptr->tone, ptr->vpid, ptr->apid1, ptr->apid2, ptr->tpid, ptr->progid); |
190 } | 201 } |
202 | |
203 | |
204 if(((ptr->vpid <= 0) && (ptr->apid1 <=0)) || (ptr->freq == 0)) | |
205 continue; | |
191 | 206 |
192 | 207 |
193 if((type == TUNER_TER) || (type == TUNER_CBL)) | 208 if((type == TUNER_TER) || (type == TUNER_CBL)) |
194 { | 209 { |
195 if(! strcmp(inv, "INVERSION_ON")) | 210 if(! strcmp(inv, "INVERSION_ON")) |