Revision 1447dc59 libavformat/aviobuf.c

View differences:

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';

Also available in: Unified diff