Feature #2599 » tvheadend.patch
tvheadend.new/src/service_mapper.c 2015-02-04 21:00:05.000000000 +0100 | ||
---|---|---|
103 | 103 | |
104 | 104 |
/* Already mapped (or in progress) */ |
105 | 105 |
if (s->s_sm_onqueue) continue; |
106 |
if (LIST_FIRST(&s->s_channels)) continue; |
|
107 | 106 |
tvhtrace("service_mapper", " not mapped"); |
108 | 107 |
service_mapper_stat.total++; |
109 | 108 |
service_mapper_stat.ignore++; |
... | ... | |
278 | 277 |
goto exit; |
279 | 278 |
} |
280 | 279 | |
281 |
/* Safety check (in-case something has been mapped manually in the interim) */ |
|
282 |
if (!bq && LIST_FIRST(&s->s_channels)) { |
|
283 |
service_mapper_stat.ignore++; |
|
284 |
goto exit; |
|
285 |
} |
|
286 | ||
287 | 280 |
/* Find existing channel */ |
288 | 281 |
name = service_get_channel_name(s); |
289 |
if (!bq && service_mapper_conf.merge_same_name && name && *name)
|
|
282 |
if (!bq && (LIST_FIRST(&s->s_channels) || service_mapper_conf.merge_same_name) && name && *name)
|
|
290 | 283 |
chn = channel_find_by_name(name); |
291 | 284 |
if (!chn) { |
292 | 285 |
chn = channel_create(NULL, NULL, NULL); |
... | ... | |
436 | 429 |
subscription_unsubscribe(sub); |
437 | 430 | |
438 | 431 |
if(err) { |
432 |
service_set_enabled((service_t *)s, 0, s->s_auto); |
|
433 | ||
439 | 434 |
tvhinfo("service_mapper", "%s: failed [err %s]", s->s_nicename, err); |
440 | 435 |
service_mapper_stat.fail++; |
441 | 436 |
} else |