Changeset 5031


Ignore:
Timestamp:
Mar 26, 2015 10:38:30 AM (4 years ago)
Author:
riza
Message:

Re #1831: Fixed matching algorithm when the supported format only have one size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/vid_port.c

    r5026 r5031  
    347347    /* No need to calculate ratio if exact match is found. */ 
    348348    if (!found_exact_match) { 
     349        pj_bool_t found_match = PJ_FALSE; 
     350 
    349351        /* We have the list of supported format with nearest width. Now get the  
    350352         * best ratio. 
     
    361363            diff_ratio = GET_DIFF(sup_ratio, req_ratio); 
    362364 
    363             if ((i==0) || (diff_ratio <= min_diff_ratio)) { 
     365            if ((!found_match) || (diff_ratio <= min_diff_ratio)) { 
     366                found_match = PJ_TRUE; 
    364367                match_idx = i; 
    365368                min_diff_ratio = diff_ratio; 
Note: See TracChangeset for help on using the changeset viewer.