pcr |= ((uint64_t)tsb[10] >> 7) & 0x01;
/* handle the broken info using candidate variable */
if (t->s_current_pcr == PTS_UNSET || t->s_current_pcr_guess ||
- pts_diff(t->s_current_pcr, pcr) <= 90000 ||
- (t->s_candidate_pcr != PTS_UNSET && pts_diff(t->s_candidate_pcr, pcr) <= 90000)) {
+ pts_diff(t->s_current_pcr, pcr) <= (int64_t)t->s_pcr_boundary ||
+ (t->s_candidate_pcr != PTS_UNSET &&
+ pts_diff(t->s_candidate_pcr, pcr) <= (int64_t)t->s_pcr_boundary)) {
if (pcr != t->s_current_pcr) {
if (t->s_current_pcr == PTS_UNSET)
tvhtrace(LS_PCR, "%s: initial : %"PRId64, service_nicename((service_t*)t), pcr);
t->s_scrambled_seen = 0;
t->s_scrambled_pass = !!(flags & SUBSCRIPTION_NODESCR);
t->s_start_time = mclk();
+ t->s_pcr_boundary = 90000;
pthread_mutex_lock(&t->s_stream_mutex);
service_build_filter(t);
descrambler_caid_changed(t);
+ if (service_has_no_audio(t, 1))
+ t->s_pcr_boundary = 4*90000;
+
if((r = t->s_start_feed(t, instance, weight, flags)))
return r;
return 0;
}
+int
+service_has_no_audio(service_t *t, int filtered)
+{
+ elementary_stream_t *st;
+ TAILQ_FOREACH(st, filtered ? &t->s_filt_components :
+ &t->s_components, es_link)
+ if (SCT_ISAUDIO(st->es_type))
+ return 0;
+ return 1;
+}
+
int
service_is_sdtv(service_t *t)
{
int s_prio;
int s_type_user;
int s_pts_shift; // in ms (may be negative)
+ int s_pcr_boundary;
LIST_ENTRY(service) s_active_link;
const char *service_servicetype_txt(service_t *t);
int service_has_audio_or_video(service_t *t);
+int service_has_no_audio(service_t *t, int filtered);
int service_is_sdtv(service_t *t);
int service_is_uhdtv(service_t *t);
int service_is_hdtv(service_t *t);