Revision e356fc57 libavformat/asfdec.c

View differences:

libavformat/asfdec.c
350 350
        avio_rl16(pb); /* panes */
351 351
        st->codec->bits_per_coded_sample = avio_rl16(pb); /* depth */
352 352
        tag1 = avio_rl32(pb);
353
        url_fskip(pb, 20);
353
        avio_seek(pb, 20, SEEK_CUR);
354 354
        //                av_log(s, AV_LOG_DEBUG, "size:%d tsize:%d sizeX:%d\n", size, total_size, sizeX);
355 355
        if (sizeX > 40) {
356 356
            st->codec->extradata_size = sizeX - 40;
......
388 388
            st->need_parsing = AVSTREAM_PARSE_FULL_ONCE;
389 389
    }
390 390
    pos2 = url_ftell(pb);
391
    url_fskip(pb, size - (pos2 - pos1 + 24));
391
    avio_seek(pb, size - (pos2 - pos1 + 24), SEEK_CUR);
392 392

  
393 393
    return 0;
394 394
}
......
455 455
    get_tag(s, "author"   , 0, len2);
456 456
    get_tag(s, "copyright", 0, len3);
457 457
    get_tag(s, "comment"  , 0, len4);
458
    url_fskip(pb, len5);
458
    avio_seek(pb, len5, SEEK_CUR);
459 459

  
460 460
    return 0;
461 461
}
......
475 475
        if (name_len%2)     // must be even, broken lavf versions wrote len-1
476 476
            name_len += 1;
477 477
        if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
478
            url_fskip(pb, name_len - ret);
478
            avio_seek(pb, name_len - ret, SEEK_CUR);
479 479
        value_type = avio_rl16(pb);
480 480
        value_len  = avio_rl16(pb);
481 481
        if (!value_type && value_len%2)
......
505 505
        char lang[6];
506 506
        unsigned int lang_len = avio_r8(pb);
507 507
        if ((ret = avio_get_str16le(pb, lang_len, lang, sizeof(lang))) < lang_len)
508
            url_fskip(pb, lang_len - ret);
508
            avio_seek(pb, lang_len - ret, SEEK_CUR);
509 509
        if (j < 128)
510 510
            av_strlcpy(asf->stream_languages[j], lang, sizeof(*asf->stream_languages));
511 511
    }
......
531 531
        value_len=  avio_rl32(pb);
532 532

  
533 533
        if ((ret = avio_get_str16le(pb, name_len, name, sizeof(name))) < name_len)
534
            url_fskip(pb, name_len - ret);
534
            avio_seek(pb, name_len - ret, SEEK_CUR);
535 535
        //av_log(s, AV_LOG_ERROR, "%d %d %d %d %d <%s>\n", i, stream_num, name_len, value_type, value_len, name);
536 536
        value_num= avio_rl16(pb);//we should use get_value() here but it does not work 2 is le16 here but le32 elsewhere
537
        url_fskip(pb, value_len - 2);
537
        avio_seek(pb, value_len - 2, SEEK_CUR);
538 538

  
539 539
        if(stream_num<128){
540 540
            if     (!strcmp(name, "AspectRatioX")) asf->dar[stream_num].num= value_num;
......
571 571
        avio_rl32(pb);             // flags
572 572
        name_len = avio_rl32(pb);  // name length
573 573
        if ((ret = avio_get_str16le(pb, name_len * 2, name, sizeof(name))) < name_len)
574
            url_fskip(pb, name_len - ret);
574
            avio_seek(pb, name_len - ret, SEEK_CUR);
575 575
        ff_new_chapter(s, i, (AVRational){1, 10000000}, pres_time, AV_NOPTS_VALUE, name );
576 576
    }
577 577

  
......
826 826
//            for(i=0; i<asf->packet_replic_size-8; i++)
827 827
//                av_log(s, AV_LOG_DEBUG, "%02X ",avio_r8(pb));
828 828
//            av_log(s, AV_LOG_DEBUG, "\n");
829
            url_fskip(pb, 10);
829
            avio_seek(pb, 10, SEEK_CUR);
830 830
            ts0= avio_rl64(pb);
831 831
            ts1= avio_rl64(pb);
832
            url_fskip(pb, 12);
832
            avio_seek(pb, 12, SEEK_CUR);
833 833
            avio_rl32(pb);
834
            url_fskip(pb, asf->packet_replic_size - 8 - 38 - 4);
834
            avio_seek(pb, asf->packet_replic_size - 8 - 38 - 4, SEEK_CUR);
835 835
            if(ts0!= -1) asf->packet_frag_timestamp= ts0/10000;
836 836
            else         asf->packet_frag_timestamp= AV_NOPTS_VALUE;
837 837
        }else
838
            url_fskip(pb, asf->packet_replic_size - 8);
838
            avio_seek(pb, asf->packet_replic_size - 8, SEEK_CUR);
839 839
        rsize += asf->packet_replic_size; // FIXME - check validity
840 840
    } else if (asf->packet_replic_size==1){
841 841
        // multipacket - frag_offset is beginning timestamp
......
895 895
            //printf("PacketLeftSize:%d  Pad:%d Pos:%"PRId64"\n", asf->packet_size_left, asf->packet_padsize, url_ftell(pb));
896 896
            assert(ret>=0);
897 897
            /* fail safe */
898
            url_fskip(pb, ret);
898
            avio_seek(pb, ret, SEEK_CUR);
899 899

  
900 900
            asf->packet_pos= url_ftell(pb);
901 901
            if (asf->data_object_size != (uint64_t)-1 &&
......
914 914
                ) {
915 915
                asf->packet_time_start = 0;
916 916
                /* unhandled packet (should not happen) */
917
                url_fskip(pb, asf->packet_frag_size);
917
                avio_seek(pb, asf->packet_frag_size, SEEK_CUR);
918 918
                asf->packet_size_left -= asf->packet_frag_size;
919 919
                if(asf->stream_index < 0)
920 920
                    av_log(s, AV_LOG_ERROR, "ff asf skip %d (unknown stream)\n", asf->packet_frag_size);
......
934 934
            if (asf->packet_multi_size < asf->packet_obj_size)
935 935
            {
936 936
                asf->packet_time_start = 0;
937
                url_fskip(pb, asf->packet_multi_size);
937
                avio_seek(pb, asf->packet_multi_size, SEEK_CUR);
938 938
                asf->packet_size_left -= asf->packet_multi_size;
939 939
                continue;
940 940
            }

Also available in: Unified diff