Mercurial > libavformat.hg
comparison aviobuf.c @ 6311:daed56aa74bc libavformat
Simplify get_byte and url_fgetc.
author | reimar |
---|---|
date | Sun, 25 Jul 2010 14:33:40 +0000 |
parents | 175c5f6cb556 |
children | b69e2ca7fb3f |
comparison
equal
deleted
inserted
replaced
6310:3d61da0c6e41 | 6311:daed56aa74bc |
---|---|
388 } | 388 } |
389 | 389 |
390 /* XXX: put an inline version */ | 390 /* XXX: put an inline version */ |
391 int get_byte(ByteIOContext *s) | 391 int get_byte(ByteIOContext *s) |
392 { | 392 { |
393 if (s->buf_ptr < s->buf_end) { | 393 if (s->buf_ptr >= s->buf_end) |
394 return *s->buf_ptr++; | |
395 } else { | |
396 fill_buffer(s); | 394 fill_buffer(s); |
397 if (s->buf_ptr < s->buf_end) | 395 if (s->buf_ptr < s->buf_end) |
398 return *s->buf_ptr++; | 396 return *s->buf_ptr++; |
399 else | 397 else |
400 return 0; | 398 return 0; |
401 } | |
402 } | 399 } |
403 | 400 |
404 int url_fgetc(ByteIOContext *s) | 401 int url_fgetc(ByteIOContext *s) |
405 { | 402 { |
406 if (s->buf_ptr < s->buf_end) { | 403 if (s->buf_ptr >= s->buf_end) |
407 return *s->buf_ptr++; | |
408 } else { | |
409 fill_buffer(s); | 404 fill_buffer(s); |
410 if (s->buf_ptr < s->buf_end) | 405 if (s->buf_ptr < s->buf_end) |
411 return *s->buf_ptr++; | 406 return *s->buf_ptr++; |
412 else | 407 else |
413 return URL_EOF; | 408 return URL_EOF; |
414 } | |
415 } | 409 } |
416 | 410 |
417 int get_buffer(ByteIOContext *s, unsigned char *buf, int size) | 411 int get_buffer(ByteIOContext *s, unsigned char *buf, int size) |
418 { | 412 { |
419 int len, size1; | 413 int len, size1; |