Revision d7fb5a18

View differences:

libavformat/asf.c
559 559
 *
560 560
 * @return <0 in case of an error
561 561
 */
562
static int asf_get_packet(AVFormatContext *s)
562
static int asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
563 563
{
564 564
    ASFContext *asf = s->priv_data;
565
    ByteIOContext *pb = s->pb;
566 565
    uint32_t packet_length, padsize;
567 566
    int rsize = 8;
568 567
    int c, d, e, off;
......
634 633
 *
635 634
 * @return <0 if error
636 635
 */
637
static int asf_read_frame_header(AVFormatContext *s){
636
static int asf_read_frame_header(AVFormatContext *s, ByteIOContext *pb){
638 637
    ASFContext *asf = s->priv_data;
639
    ByteIOContext *pb = s->pb;
640 638
    int rsize = 1;
641 639
    int num = get_byte(pb);
642 640
    int64_t ts0, ts1;
......
711 709
 * @returns 0 if data was stored in pkt, <0 on error or 1 if more ASF
712 710
 *          packets need to be loaded (through asf_get_packet())
713 711
 */
714
static int asf_parse_packet(AVFormatContext *s, AVPacket *pkt)
712
static int asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket *pkt)
715 713
{
716 714
    ASFContext *asf = s->priv_data;
717 715
    ASFStream *asf_st = 0;
718
    ByteIOContext *pb = s->pb;
719 716
    for (;;) {
720 717
        if(url_feof(pb))
721 718
            return AVERROR(EIO);
......
735 732
            return 1;
736 733
        }
737 734
        if (asf->packet_time_start == 0) {
738
            if(asf_read_frame_header(s) < 0){
735
            if(asf_read_frame_header(s, s->pb) < 0){
739 736
                asf->packet_segments= 0;
740 737
                continue;
741 738
            }
......
887 884
        int ret;
888 885

  
889 886
        /* parse cached packets, if any */
890
        if ((ret = asf_parse_packet(s, pkt)) <= 0)
887
        if ((ret = asf_parse_packet(s, s->pb, pkt)) <= 0)
891 888
            return ret;
892
        if ((ret = asf_get_packet(s)) < 0)
889
        if ((ret = asf_get_packet(s, s->pb)) < 0)
893 890
            assert(asf->packet_size_left < FRAME_HEADER_SIZE || asf->packet_segments < 1);
894 891
        asf->packet_time_start = 0;
895 892
    }

Also available in: Unified diff