Revision 392f2273

View differences:

libavformat/cutils.c
77 77

  
78 78
    /* oh well, may be someone some day will invent a formula for this stuff */
79 79
    y = 1970; /* start "guessing" */
80
    while (days >= (ISLEAP(y)?366:365)) {
80
    while (days > 365) {
81 81
        ny = (y + days/366);
82 82
        days -= (ny - y) * 365 + LEAPS_COUNT(ny - 1) - LEAPS_COUNT(y - 1);
83 83
        y = ny;
84 84
    }
85
    if (days==365 && !ISLEAP(y)) { days=0; y++; }
85 86
    md[1] = ISLEAP(y)?29:28;
86 87
    for (m=0; days >= md[m]; m++)
87 88
         days -= md[m];

Also available in: Unified diff