diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-17 18:05:55 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-17 18:05:55 +0000 |
commit | 8771ad0741e1294665b5e244f3b0ad599bbca245 (patch) | |
tree | f5a5b838708302b4e83f1fae3e626d65ec65f481 | |
parent | e41e46ea1fc6d74095c19810cf3b357482a1c35d (diff) |
add a demux_peekc function that allows to just "have a look" at the next
byte of data from the demuxer.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16505 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/demuxer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libmpdemux/demuxer.h b/libmpdemux/demuxer.h index 498e1d5b59..b25aa15bef 100644 --- a/libmpdemux/demuxer.h +++ b/libmpdemux/demuxer.h @@ -257,6 +257,9 @@ inline static int ds_tell_pts(demux_stream_t *ds){ 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++] \ |