Revision e356fc57 libavformat/avidec.c

View differences:

libavformat/avidec.c
321 321
                }
322 322
                if (name)
323 323
                    av_metadata_set2(&s->metadata, name, buffer, 0);
324
                url_fskip(s->pb, size);
324
                avio_seek(s->pb, size, SEEK_CUR);
325 325
            }
326 326
            break;
327 327
        }
328 328
        default:
329
            url_fskip(s->pb, size);
329
            avio_seek(s->pb, size, SEEK_CUR);
330 330
            break;
331 331
        }
332 332
    }
......
392 392
            unsigned char date[64] = {0};
393 393
            size += (size & 1);
394 394
            size -= avio_read(pb, date, FFMIN(size, sizeof(date)-1));
395
            url_fskip(pb, size);
395
            avio_seek(pb, size, SEEK_CUR);
396 396
            avi_metadata_creation_time(&s->metadata, date);
397 397
            break;
398 398
        }
399 399
        case MKTAG('d', 'm', 'l', 'h'):
400 400
            avi->is_odml = 1;
401
            url_fskip(pb, size + (size & 1));
401
            avio_seek(pb, size + (size & 1), SEEK_CUR);
402 402
            break;
403 403
        case MKTAG('a', 'm', 'v', 'h'):
404 404
            amv_file_format=1;
......
410 410
            avio_rl32(pb);
411 411
            avi->non_interleaved |= avio_rl32(pb) & AVIF_MUSTUSEINDEX;
412 412

  
413
            url_fskip(pb, 2 * 4);
413
            avio_seek(pb, 2 * 4, SEEK_CUR);
414 414
            avio_rl32(pb);
415 415
            avio_rl32(pb);
416 416
            avih_width=avio_rl32(pb);
417 417
            avih_height=avio_rl32(pb);
418 418

  
419
            url_fskip(pb, size - 10 * 4);
419
            avio_seek(pb, size - 10 * 4, SEEK_CUR);
420 420
            break;
421 421
        case MKTAG('s', 't', 'r', 'h'):
422 422
            /* stream header */
......
425 425
            handler = avio_rl32(pb); /* codec tag */
426 426

  
427 427
            if(tag1 == MKTAG('p', 'a', 'd', 's')){
428
                url_fskip(pb, size - 8);
428
                avio_seek(pb, size - 8, SEEK_CUR);
429 429
                break;
430 430
            }else{
431 431
                stream_index++;
......
469 469
                        goto fail;
470 470
                }
471 471
                s->streams[0]->priv_data = ast;
472
                url_fskip(pb, 3 * 4);
472
                avio_seek(pb, 3 * 4, SEEK_CUR);
473 473
                ast->scale = avio_rl32(pb);
474 474
                ast->rate = avio_rl32(pb);
475
                url_fskip(pb, 4);  /* start time */
475
                avio_seek(pb, 4, SEEK_CUR);  /* start time */
476 476

  
477 477
                dv_dur = avio_rl32(pb);
478 478
                if (ast->scale > 0 && ast->rate > 0 && dv_dur > 0) {
......
485 485
                 */
486 486

  
487 487
                stream_index = s->nb_streams - 1;
488
                url_fskip(pb, size - 9*4);
488
                avio_seek(pb, size - 9*4, SEEK_CUR);
489 489
                break;
490 490
            }
491 491

  
......
542 542
            if(ast->sample_size == 0)
543 543
                st->duration = st->nb_frames;
544 544
            ast->frame_offset= ast->cum_len;
545
            url_fskip(pb, size - 12 * 4);
545
            avio_seek(pb, size - 12 * 4, SEEK_CUR);
546 546
            break;
547 547
        case MKTAG('s', 't', 'r', 'f'):
548 548
            /* stream header */
549 549
            if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
550
                url_fskip(pb, size);
550
                avio_seek(pb, size, SEEK_CUR);
551 551
            } else {
552 552
                uint64_t cur_pos = url_ftell(pb);
553 553
                if (cur_pos < list_end)
......
560 560
                        st->codec->height=avih_height;
561 561
                        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
562 562
                        st->codec->codec_id = CODEC_ID_AMV;
563
                        url_fskip(pb, size);
563
                        avio_seek(pb, size, SEEK_CUR);
564 564
                        break;
565 565
                    }
566 566
                    tag1 = ff_get_bmp_header(pb, st);
......
620 620
                    }
621 621
                    st->codec->height= FFABS(st->codec->height);
622 622

  
623
//                    url_fskip(pb, size - 5 * 4);
623
//                    avio_seek(pb, size - 5 * 4, SEEK_CUR);
624 624
                    break;
625 625
                case AVMEDIA_TYPE_AUDIO:
626 626
                    ff_get_wav_header(pb, st->codec, size);
......
630 630
                        ast->sample_size= st->codec->block_align;
631 631
                    }
632 632
                    if (size&1) /* 2-aligned (fix for Stargate SG-1 - 3x18 - Shades of Grey.avi) */
633
                        url_fskip(pb, 1);
633
                        avio_seek(pb, 1, SEEK_CUR);
634 634
                    /* Force parsing as several audio frames can be in
635 635
                     * one packet and timestamps refer to packet start. */
636 636
                    st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
......
658 658
                    st->codec->codec_type = AVMEDIA_TYPE_DATA;
659 659
                    st->codec->codec_id= CODEC_ID_NONE;
660 660
                    st->codec->codec_tag= 0;
661
                    url_fskip(pb, size);
661
                    avio_seek(pb, size, SEEK_CUR);
662 662
                    break;
663 663
                }
664 664
            }
......
710 710
            }
711 711
            /* skip tag */
712 712
            size += (size & 1);
713
            url_fskip(pb, size);
713
            avio_seek(pb, size, SEEK_CUR);
714 714
            break;
715 715
        }
716 716
    }
......
762 762
            goto error;
763 763

  
764 764
        ret = avio_get_str16le(pb, desc_len, desc, sizeof(desc));
765
        url_fskip(pb, desc_len - ret);
765
        avio_seek(pb, desc_len - ret, SEEK_CUR);
766 766
        if (*desc)
767 767
            av_metadata_set2(&st->metadata, "title", desc, 0);
768 768

  
......
1008 1008
        //parse JUNK
1009 1009
           ||(d[0] == 'J' && d[1] == 'U' && d[2] == 'N' && d[3] == 'K')
1010 1010
           ||(d[0] == 'i' && d[1] == 'd' && d[2] == 'x' && d[3] == '1')){
1011
            url_fskip(pb, size);
1011
            avio_seek(pb, size, SEEK_CUR);
1012 1012
//av_log(s, AV_LOG_DEBUG, "SKIP\n");
1013 1013
            goto resync;
1014 1014
        }
1015 1015

  
1016 1016
        //parse stray LIST
1017 1017
        if(d[0] == 'L' && d[1] == 'I' && d[2] == 'S' && d[3] == 'T'){
1018
            url_fskip(pb, 4);
1018
            avio_seek(pb, 4, SEEK_CUR);
1019 1019
            goto resync;
1020 1020
        }
1021 1021

  
......
1026 1026

  
1027 1027
        //detect ##ix chunk and skip
1028 1028
        if(d[2] == 'i' && d[3] == 'x' && n < s->nb_streams){
1029
            url_fskip(pb, size);
1029
            avio_seek(pb, size, SEEK_CUR);
1030 1030
            goto resync;
1031 1031
        }
1032 1032

  
......
1060 1060
               /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & AV_PKT_FLAG_KEY))*/ //FIXME needs a little reordering
1061 1061
               || st->discard >= AVDISCARD_ALL){
1062 1062
                ast->frame_offset += get_duration(ast, size);
1063
                url_fskip(pb, size);
1063
                avio_seek(pb, size, SEEK_CUR);
1064 1064
                goto resync;
1065 1065
            }
1066 1066

  

Also available in: Unified diff