Revision 175389c8

View differences:

libavformat/avio.c
374 374
    return 1;
375 375
}
376 376

  
377
int avio_check(const char *url, int flags)
378
{
379
    URLContext *h;
380
    int ret = ffurl_alloc(&h, url, flags);
381
    if (ret)
382
        return ret;
383

  
384
    if (h->prot->url_check) {
385
        ret = h->prot->url_check(h, flags);
386
    } else {
387
        ret = ffurl_connect(h);
388
        if (ret >= 0)
389
            ret = flags;
390
    }
391

  
392
    ffurl_close(h);
393
    return ret;
394
}
395

  
377 396
int64_t ffurl_size(URLContext *h)
378 397
{
379 398
    int64_t pos, size;
libavformat/avio.h
134 134
    int priv_data_size;
135 135
    const AVClass *priv_data_class;
136 136
    int flags;
137
    int (*url_check)(URLContext *h, int mask);
137 138
} URLProtocol;
138 139

  
139 140
typedef struct URLPollEntry {
......
347 348
int url_exist(const char *url);
348 349

  
349 350
/**
351
 * Return AVIO_* access flags corresponding to the access permissions
352
 * of the resource in url, or a negative value corresponding to an
353
 * AVERROR code in case of failure. The returned access flags are
354
 * masked by the value in flags.
355
 *
356
 * @note This function is intrinsically unsafe, in the sense that the
357
 * checked resource may change its existence or permission status from
358
 * one call to another. Thus you should not trust the returned value,
359
 * unless you are sure that no other processes are accessing the
360
 * checked resource.
361
 *
362
 * @note This function is slightly broken until next major bump
363
 *       because of AVIO_RDONLY == 0. Don't use it until then.
364
 */
365
int avio_check(const char *url, int flags);
366

  
367
/**
350 368
 * The callback is called in blocking functions to test regulary if
351 369
 * asynchronous interruption is needed. AVERROR_EXIT is returned
352 370
 * in this case by the interrupted function. 'NULL' means no interrupt
libavformat/url.h
59 59
    int priv_data_size;
60 60
    const AVClass *priv_data_class;
61 61
    int flags;
62
    int (*url_check)(URLContext *h, int mask);
62 63
} URLProtocol;
63 64
#endif
64 65

  

Also available in: Unified diff