Revision e8acf0ed

View differences:

libavformat/rtsp.c
1435 1435
    return 0;
1436 1436
}
1437 1437

  
1438
/* called from utils.c */
1439
int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f)
1438
static int redir_read_header(AVFormatContext *s, AVFormatParameters *ap)
1440 1439
{
1441 1440
    char buf[4096], *q;
1442 1441
    int c;
1443 1442
    AVFormatContext *ic = NULL;
1443
    ByteIOContext *f = s->pb;
1444 1444

  
1445 1445
    /* parse each URL and try to open it */
1446 1446
    c = url_fgetc(f);
......
1468 1468
        if (av_open_input_file(&ic, buf, NULL, 0, NULL) == 0)
1469 1469
            break;
1470 1470
    }
1471
    *ic_ptr = ic;
1472 1471
    if (!ic)
1473 1472
        return AVERROR(EIO);
1474
    else
1475
        return 0;
1473

  
1474
    *s = *ic;
1475
    url_fclose(f);
1476

  
1477
    return 0;
1476 1478
}
1477 1479

  
1478 1480
AVInputFormat redir_demuxer = {
......
1480 1482
    "Redirector format",
1481 1483
    0,
1482 1484
    redir_probe,
1483
    NULL,
1485
    redir_read_header,
1484 1486
    NULL,
1485 1487
    NULL,
1486 1488
};
libavformat/utils.c
464 464
        goto fail;
465 465
    }
466 466

  
467
    /* XXX: suppress this hack for redirectors */
468
#ifdef CONFIG_REDIR_DEMUXER
469
    if (!strcmp(fmt->name, "redir")) {
470
        int redir_open(AVFormatContext **ic_ptr, ByteIOContext *f);
471
        err = redir_open(ic_ptr, pb);
472
        url_fclose(pb);
473
        return err;
474
    }
475
#endif
476

  
477 467
    /* check filename in case of an image number is expected */
478 468
    if (fmt->flags & AVFMT_NEEDNUMBER) {
479 469
        if (!av_filename_number_test(filename)) {

Also available in: Unified diff