Mercurial > mplayer.hg
changeset 16504:aa2b250ba16b
add a demux_peekc function that allows to just "have a look" at the next
byte of data from the demuxer.
author | reimar |
---|---|
date | Sat, 17 Sep 2005 18:05:55 +0000 |
parents | b7fc08b7e1aa |
children | cb6599e433d7 |
files | libmpdemux/demuxer.h |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demuxer.h Sat Sep 17 05:46:20 2005 +0000 +++ b/libmpdemux/demuxer.h Sat Sep 17 18:05:55 2005 +0000 @@ -257,6 +257,9 @@ int demux_read_data(demux_stream_t *ds,unsigned char* mem,int len); int demux_read_data_pack(demux_stream_t *ds,unsigned char* mem,int len); +#define demux_peekc(ds) (\ + (likely(ds->buffer_pos<ds->buffer_size)) ? ds->buffer[ds->buffer_pos] \ + :((unlikely(!ds_fill_buffer(ds)))? (-1) : ds->buffer[ds->buffer_pos] ) ) #if 1 #define demux_getc(ds) (\ (likely(ds->buffer_pos<ds->buffer_size)) ? ds->buffer[ds->buffer_pos++] \