aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--edid-decode.h11
-rw-r--r--parse-cta-block.cpp13
2 files changed, 15 insertions, 9 deletions
diff --git a/edid-decode.h b/edid-decode.h
index 998ccab..9c2044d 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -114,8 +114,8 @@ struct edid_state {
// CTA-861 block state
cta.has_vic_1 = cta.first_svd_might_be_preferred =
cta.has_hdmi = cta.has_vcdb = cta.has_vfpdb = false;
- cta.last_block_was_hdmi_vsdb = cta.have_hf_vsdb = cta.have_hf_scdb = 0;
- cta.first_block = 1;
+ cta.last_block_was_hdmi_vsdb = cta.have_hf_vsdb = cta.have_hf_scdb = false;
+ cta.first_block = cta.first_svd = true;
cta.supported_hdmi_vic_codes = cta.supported_hdmi_vic_vsb_codes = 0;
memset(cta.vics, 0, sizeof(cta.vics));
memset(cta.preparsed_has_vic, 0, sizeof(cta.preparsed_has_vic));
@@ -195,9 +195,10 @@ struct edid_state {
bool has_vcdb;
bool has_vfpdb;
unsigned short preparsed_phys_addr;
- int last_block_was_hdmi_vsdb;
- int have_hf_vsdb, have_hf_scdb;
- int first_block;
+ bool last_block_was_hdmi_vsdb;
+ bool have_hf_vsdb, have_hf_scdb;
+ bool first_block;
+ bool first_svd;
unsigned supported_hdmi_vic_codes;
unsigned supported_hdmi_vic_vsb_codes;
unsigned short vics[256][2];
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index 75bd4a3..97924d1 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -379,8 +379,8 @@ void edid_state::cta_svd(const unsigned char *x, unsigned n, bool for_ycbcr420)
cta.supported_hdmi_vic_vsb_codes |= 1 << 3;
break;
}
- bool override_pref = i == 0 && !for_ycbcr420 &&
- cta.first_svd_might_be_preferred;
+ bool first_svd = cta.first_svd && !for_ycbcr420;
+ bool override_pref = first_svd && cta.first_svd_might_be_preferred;
char type[16];
sprintf(type, "VIC %3u", vic);
@@ -394,9 +394,14 @@ void edid_state::cta_svd(const unsigned char *x, unsigned n, bool for_ycbcr420)
print_timings(" ", t, type, flags);
}
if (override_pref) {
- cta.preferred_timings.clear();
- cta.preferred_timings.push_back(timings_ext(*t, type, flags));
+ cta.preferred_timings.insert(cta.preferred_timings.begin(),
+ timings_ext(*t, type, flags));
warn("VIC %u is the preferred timing, overriding the first detailed timings. Is this intended?\n", vic);
+ } else if (first_svd) {
+ cta.preferred_timings.push_back(timings_ext(*t, type, flags));
+ }
+ if (first_svd) {
+ cta.first_svd = false;
cta.first_svd_might_be_preferred = false;
}
if (native)

Privacy Policy