if (!old_channel) return 1;
/* Always prefer a recording that has the correct service profile
- * (UHD, HD, SD). Someone mentioned (#1846) that some channels can
+ * (UHD, FHD, HD, SD). Someone mentioned (#1846) that some channels can
* show a recording earlier in the week in SD then later in the week
* in HD so this would prefer the later HD recording if the user so
* desired.
return 0;
if (!old_has_svf && new_has_svf)
return 1;
- /* Also try "downgrading", where user asks for UHD, which we don't
+ /* Also try "downgrading", where user asks for FHD, which we don't
* have, but we could give them HD.
*/
+ if (svf == PROFILE_SVF_FHD && !old_has_svf) {
+ old_has_svf = channel_has_correct_service_filter(old_channel, PROFILE_SVF_HD);
+ new_has_svf = channel_has_correct_service_filter(new_channel, PROFILE_SVF_HD);
+
+ if (old_has_svf && !new_has_svf)
+ return 0;
+ if (!old_has_svf && new_has_svf)
+ return 1;
+ }
+
+ /* Also try "downgrading", where user asks for UHD, which we don't
+ * have, but we could give them FHD, then HD.
+ */
if (svf == PROFILE_SVF_UHD && !old_has_svf) {
+ old_has_svf = channel_has_correct_service_filter(old_channel, PROFILE_SVF_FHD);
+ new_has_svf = channel_has_correct_service_filter(new_channel, PROFILE_SVF_FHD);
+
+ if (!old_has_svf && new_has_svf)
+ return 1;
+
old_has_svf = channel_has_correct_service_filter(old_channel, PROFILE_SVF_HD);
new_has_svf = channel_has_correct_service_filter(new_channel, PROFILE_SVF_HD);
{ N_("Radio"), ST_RADIO },
{ N_("SD TV"), ST_SDTV },
{ N_("HD TV"), ST_HDTV },
+ { N_("FHD TV"), ST_FHDTV },
{ N_("UHD TV"), ST_UHDTV }
};
return strtab2htsmsg(tab, 1, lang);
pro->pro_svfilter == PROFILE_SVF_NONE ||
(pro->pro_svfilter == PROFILE_SVF_SD && service_is_sdtv(s)) ||
(pro->pro_svfilter == PROFILE_SVF_HD && service_is_hdtv(s)) ||
+ (pro->pro_svfilter == PROFILE_SVF_FHD && service_is_fhdtv(s)) ||
(pro->pro_svfilter == PROFILE_SVF_UHD && service_is_uhdtv(s))) {
r1 = s->s_enlist(s, ti, sil, flags, weight);
if (r1 && r == 0)
/* find a valid instance, no error and "user" idle */
TAILQ_FOREACH(si, sil, si_link)
if (si->si_weight < SUBSCRIPTION_PRIO_MIN && si->si_error == 0) break;
- /* UHD->HD fallback and SD->HD fallback */
+ /* SD->HD->FHD->UHD fallback */
if (si == NULL && pro &&
- (pro->pro_svfilter == PROFILE_SVF_UHD ||
- pro->pro_svfilter == PROFILE_SVF_SD)) {
+ pro->pro_svfilter == PROFILE_SVF_SD) {
LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
s = (service_t *)ilm->ilm_in1;
if (s->s_is_enabled(s, flags) && service_is_hdtv(s)) {
r = r1;
}
}
+ LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
+ s = (service_t *)ilm->ilm_in1;
+ if (s->s_is_enabled(s, flags) && service_is_fhdtv(s)) {
+ r1 = s->s_enlist(s, ti, sil, flags, weight);
+ if (r1 && r == 0)
+ r = r1;
+ }
+ }
+ LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
+ s = (service_t *)ilm->ilm_in1;
+ if (s->s_is_enabled(s, flags) && service_is_uhdtv(s)) {
+ r1 = s->s_enlist(s, ti, sil, flags, weight);
+ if (r1 && r == 0)
+ r = r1;
+ }
+ }
+ /* find a valid instance, no error and "user" idle */
+ TAILQ_FOREACH(si, sil, si_link)
+ if (si->si_weight < SUBSCRIPTION_PRIO_MIN && si->si_error == 0) break;
+ }
+ /* UHD->FHD->HD->SD fallback */
+ if (si == NULL && pro &&
+ pro->pro_svfilter == PROFILE_SVF_UHD) {
+ LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
+ s = (service_t *)ilm->ilm_in1;
+ if (s->s_is_enabled(s, flags) && service_is_fhdtv(s)) {
+ r1 = s->s_enlist(s, ti, sil, flags, weight);
+ if (r1 && r == 0)
+ r = r1;
+ }
+ }
+ LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
+ s = (service_t *)ilm->ilm_in1;
+ if (s->s_is_enabled(s, flags) && service_is_hdtv(s)) {
+ r1 = s->s_enlist(s, ti, sil, flags, weight);
+ if (r1 && r == 0)
+ r = r1;
+ }
+ }
+ LIST_FOREACH(ilm, &ch->ch_services, ilm_in2_link) {
+ s = (service_t *)ilm->ilm_in1;
+ if (s->s_is_enabled(s, flags) && service_is_sdtv(s)) {
+ r1 = s->s_enlist(s, ti, sil, flags, weight);
+ if (r1 && r == 0)
+ r = r1;
+ }
+ }
/* find a valid instance, no error and "user" idle */
TAILQ_FOREACH(si, sil, si_link)
if (si->si_weight < SUBSCRIPTION_PRIO_MIN && si->si_error == 0) break;
elementary_stream_t *st;
TAILQ_FOREACH(st, &t->s_components.set_all, es_link)
if (SCT_ISVIDEO(st->es_type) &&
- st->es_height >= 720 && st->es_height <= 1080)
+ st->es_height >= 720 && st->es_height < 1080)
+ return 1;
+ }
+ return 0;
+}
+
+int
+service_is_fhdtv(const service_t *t)
+{
+ char s_type;
+ if(t->s_type_user == ST_UNSET)
+ s_type = t->s_servicetype;
+ else
+ s_type = t->s_type_user;
+ if (s_type == ST_FHDTV)
+ return 1;
+ else if (s_type == ST_NONE) {
+ elementary_stream_t *st;
+ TAILQ_FOREACH(st, &t->s_components.set_all, es_link)
+ if (SCT_ISVIDEO(st->es_type) && st->es_height == 1080)
return 1;
}
return 0;
service_servicetype_txt ( service_t *s )
{
static const char *types[] = {
- "HDTV", "SDTV", "Radio", "UHDTV", "Other"
+ "HDTV", "SDTV", "Radio", "FHDTV", "UHDTV", "Other"
};
if (service_is_hdtv(s)) return types[0];
if (service_is_sdtv(s)) return types[1];
if (service_is_radio(s)) return types[2];
- if (service_is_uhdtv(s)) return types[3];
- return types[4];
+ if (service_is_fhdtv(s)) return types[3];
+ if (service_is_uhdtv(s)) return types[4];
+ return types[5];
}
// 4HD\0 len=3, HD at pos 1 (3-2)
// 4\0 len=1
if (name[len-2] == 'H' && name[len-1] == 'D') {
- /* Ends in HD but does it end in UHD? */
+ /* Ends in HD but does it end in UHD/FHD? */
tidy_name = tvh_strdupa(name);
- if (len > 3 && name[len-3] == 'U')
+ if (len > 3 && (name[len-3] == 'U' || name[len-3] == 'F'))
tidy_name[len-3] = 0;
else
tidy_name[len-2] = 0;
if (service_is_uhdtv(s)) {
channel_tag_map(channel_tag_find_by_name("TV channels", 1), chn, chn);
channel_tag_map(channel_tag_find_by_name("UHDTV", 1), chn, chn);
+ } else if (service_is_fhdtv(s)) {
+ channel_tag_map(channel_tag_find_by_name("TV channels", 1), chn, chn);
+ channel_tag_map(channel_tag_find_by_name("FHDTV", 1), chn, chn);
} else if (service_is_hdtv(s)) {
channel_tag_map(channel_tag_find_by_name("TV channels", 1), chn, chn);
channel_tag_map(channel_tag_find_by_name("HDTV", 1), chn, chn);