Revision 873d117e libavformat/oggdec.c

View differences:

libavformat/oggdec.c
581 581
    int64_t pts = AV_NOPTS_VALUE;
582 582
    int i;
583 583
    url_fseek(bc, *pos_arg, SEEK_SET);
584
    while (url_ftell(bc) < pos_limit && !ogg_read_page (s, &i)) {
585
        if (ogg->streams[i].granule != -1 && ogg->streams[i].granule != 0 &&
586
            ogg->streams[i].codec && i == stream_index) {
587
            pts = ogg_gptopts(s, i, ogg->streams[i].granule, NULL);
588
            // FIXME: this is the position of the packet after the one with above
589
            // pts.
590
            *pos_arg = url_ftell(bc);
591
            break;
584
    ogg_reset(ogg);
585

  
586
    while (url_ftell(bc) < pos_limit && !ogg_packet(s, &i, NULL, NULL, pos_arg)) {
587
        if (i == stream_index) {
588
            pts = ogg_calc_pts(s, i, NULL);
592 589
        }
590
        if (pts != AV_NOPTS_VALUE)
591
            break;
593 592
    }
594 593
    ogg_reset(ogg);
595 594
    return pts;

Also available in: Unified diff