Revision 1447dc59

View differences:

libavformat/avio.h
426 426
attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence);
427 427
attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset);
428 428
attribute_deprecated int64_t url_ftell(AVIOContext *s);
429
#define URL_EOF (-1)
430
attribute_deprecated int url_fgetc(AVIOContext *s);
429 431
/**
430 432
 * @}
431 433
 */
......
497 499
int64_t av_url_read_fseek(AVIOContext *h, int stream_index,
498 500
                          int64_t timestamp, int flags);
499 501

  
500
#define URL_EOF (-1)
501
/** @note return URL_EOF (-1) if EOF */
502
int url_fgetc(AVIOContext *s);
503

  
504 502
/** @warning currently size is limited */
505 503
#ifdef __GNUC__
506 504
int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
libavformat/aviobuf.c
541 541
    return 0;
542 542
}
543 543

  
544
#if FF_API_OLD_AVIO
544 545
int url_fgetc(AVIOContext *s)
545 546
{
546 547
    if (s->buf_ptr >= s->buf_end)
......
549 550
        return *s->buf_ptr++;
550 551
    return URL_EOF;
551 552
}
553
#endif
552 554

  
553 555
int avio_read(AVIOContext *s, unsigned char *buf, int size)
554 556
{
......
921 923
    int c;
922 924
    char *q;
923 925

  
924
    c = url_fgetc(s);
925
    if (c == EOF)
926
    c = avio_r8(s);
927
    if (url_feof(s))
926 928
        return NULL;
927 929
    q = buf;
928 930
    for(;;) {
929
        if (c == EOF || c == '\n')
931
        if (url_feof(s) || c == '\n')
930 932
            break;
931 933
        if ((q - buf) < buf_size - 1)
932 934
            *q++ = c;
933
        c = url_fgetc(s);
935
        c = avio_r8(s);
934 936
    }
935 937
    if (buf_size > 0)
936 938
        *q = '\0';
libavformat/mpegts.c
1312 1312
    int c, i;
1313 1313

  
1314 1314
    for(i = 0;i < MAX_RESYNC_SIZE; i++) {
1315
        c = url_fgetc(pb);
1316
        if (c < 0)
1315
        c = avio_r8(pb);
1316
        if (url_feof(pb))
1317 1317
            return -1;
1318 1318
        if (c == 0x47) {
1319 1319
            avio_seek(pb, -1, SEEK_CUR);
libavformat/oggdec.c
218 218
            sync[(sp + 2) & 3] == 'g' && sync[(sp + 3) & 3] == 'S')
219 219
            break;
220 220

  
221
        c = url_fgetc (bc);
222
        if (c < 0)
221
        c = avio_r8(bc);
222
        if (url_feof(bc))
223 223
            return -1;
224 224
        sync[sp++ & 3] = c;
225 225
    }while (i++ < MAX_PAGE_SIZE);
......
229 229
        return -1;
230 230
    }
231 231

  
232
    if (url_fgetc (bc) != 0)      /* version */
232
    if (avio_r8(bc) != 0)      /* version */
233 233
        return -1;
234 234

  
235
    flags = url_fgetc (bc);
235
    flags = avio_r8(bc);
236 236
    gp = avio_rl64 (bc);
237 237
    serial = avio_rl32 (bc);
238 238
    seq = avio_rl32 (bc);
239 239
    crc = avio_rl32 (bc);
240
    nsegs = url_fgetc (bc);
240
    nsegs = avio_r8(bc);
241 241

  
242 242
    idx = ogg_find_stream (ogg, serial);
243 243
    if (idx < 0){

Also available in: Unified diff