Revision 01d91b9b libavformat/utils.c

View differences:

libavformat/utils.c
516 516
        }
517 517
    }
518 518

  
519
    av_free(buf);
520

  
521 519
    if (!*fmt) {
520
        av_free(buf);
522 521
        return AVERROR_INVALIDDATA;
523 522
    }
524 523

  
525
    if (url_fseek(*pb, 0, SEEK_SET) < 0) {
526
        url_fclose(*pb);
527
        if (url_fopen(pb, filename, URL_RDONLY) < 0)
528
            return AVERROR(EIO);
529
    }
524
    /* rewind. reuse probe buffer to avoid seeking */
525
    if ((ret = ff_rewind_with_probe_data(*pb, buf, pd.buf_size)) < 0)
526
        av_free(buf);
530 527

  
531
    return 0;
528
    return ret;
532 529
}
533 530

  
534 531
int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,

Also available in: Unified diff