1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

match resolution from high to low

This commit is contained in:
Derek Dai 2016-10-11 10:32:22 +08:00 committed by edurenye
parent 4e8fd3675d
commit 821b02bf10

View file

@ -173,7 +173,7 @@ int vfd_get_cea_resolution(uint32_t mask, int *hres, int *vres)
if (!mask)
return -EINVAL;
for (i = 0; resolutions_cea[i].hres != 0; i++) {
for (i = N_ELEMENTS(resolutions_cea) - 1; i >= 0; --i) {
if ((1 << resolutions_cea[i].index) & mask) {
*vres = resolutions_cea[i].vres;
*hres = resolutions_cea[i].hres;
@ -190,7 +190,7 @@ int vfd_get_vesa_resolution(uint32_t mask, int *hres, int *vres)
if (!mask)
return -EINVAL;
for (i = 0; resolutions_vesa[i].hres != 0; i++) {
for (N_ELEMENTS(resolutions_vesa) - 1; i >= 0; --i) {
if ((1 << resolutions_vesa[i].index) & mask) {
*vres = resolutions_vesa[i].vres;
*hres = resolutions_vesa[i].hres;
@ -207,7 +207,7 @@ int vfd_get_hh_resolution(uint32_t mask, int *hres, int *vres)
if (!mask)
return -EINVAL;
for (i = 0; resolutions_hh[i].hres != 0; i++) {
for (N_ELEMENTS(resolutions_hh); i >= 0; --i) {
if ((1 << resolutions_hh[i].index) & mask) {
*vres = resolutions_hh[i].vres;
*hres = resolutions_hh[i].hres;