Revision 73d0e331

View differences:

libavformat/avidec.c
288 288
    int i, day, year;
289 289
    /* parse standard AVI date format (ie. "Mon Mar 10 15:04:43 2003") */
290 290
    if (sscanf(date, "%*3s%*[ ]%3s%*[ ]%2d%*[ ]%8s%*[ ]%4d",
291
               month, &day, time, &year) == 4)
291
               month, &day, time, &year) == 4) {
292 292
        for (i=0; i<12; i++)
293 293
            if (!strcasecmp(month, months[i])) {
294 294
                snprintf(buffer, sizeof(buffer), "%.4d-%.2d-%.2d %s",
295 295
                         year, i+1, day, time);
296 296
                av_metadata_set2(metadata, "creation_time", buffer, 0);
297 297
            }
298
    } else if (date[4] == '/' && date[7] == '/') {
299
        date[4] = date[7] = '-';
300
        av_metadata_set2(metadata, "creation_time", date, 0);
301
    }
298 302
}
299 303

  
300 304
static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)

Also available in: Unified diff