Revision 2f3b419c libavformat/matroskadec.c

View differences:

libavformat/matroskadec.c
1089 1089
                            if ((res = ebml_read_uint (matroska, &id,
1090 1090
                                                       &num)) < 0)
1091 1091
                                break;
1092
                            track->default_duration = num/matroska->time_scale;
1092
                            track->default_duration = num;
1093 1093
                            break;
1094 1094
                        }
1095 1095

  
......
1100 1100
                                                       &num)) < 0)
1101 1101
                                break;
1102 1102
                            if (!track->default_duration)
1103
                            track->default_duration = 1000000000/(matroska->time_scale*num);
1103
                            track->default_duration = 1000000000/num;
1104 1104
                            break;
1105 1105
                        }
1106 1106

  
......
1407 1407
                uint64_t num;
1408 1408
                if ((res = ebml_read_uint(matroska, &id, &num)) < 0)
1409 1409
                    break;
1410
                track->default_duration = num / matroska->time_scale;
1410
                track->default_duration = num;
1411 1411
                break;
1412 1412
            }
1413 1413

  
......
2174 2174

  
2175 2175
            if (track->default_duration)
2176 2176
                av_reduce(&st->codec->time_base.num, &st->codec->time_base.den,
2177
                          track->default_duration, 1000, 30000);
2177
                          track->default_duration, 1000000000, 30000);
2178 2178

  
2179 2179
            if(extradata){
2180 2180
                st->codec->extradata = extradata;
......
2283 2283
        return res;
2284 2284
    }
2285 2285
    if (duration == AV_NOPTS_VALUE)
2286
        duration = matroska->tracks[track]->default_duration;
2286
        duration = matroska->tracks[track]->default_duration / matroska->time_scale;
2287 2287

  
2288 2288
    /* block_time (relative to cluster time) */
2289 2289
    block_time = AV_RB16(data);

Also available in: Unified diff