[libbluray-devel] bits: negative skips are not implemented

hpi1 git at videolan.org
Thu Apr 2 10:33:12 CEST 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Apr  2 10:23:44 2015 +0300| [9204d795aefc50e8e4370e6e61db6e2fc890ddd7] | committer: hpi1

bits: negative skips are not implemented

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=9204d795aefc50e8e4370e6e61db6e2fc890ddd7
---

 src/util/bits.c |    6 +++---
 src/util/bits.h |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/util/bits.c b/src/util/bits.c
index 1c989ea..fc3ec8d 100644
--- a/src/util/bits.c
+++ b/src/util/bits.c
@@ -182,7 +182,7 @@ uint32_t bs_read( BITSTREAM *bs, int i_count )
     return bb_read(&bs->bb, i_count);
 }
 
-void bb_skip( BITBUFFER *bb, ssize_t i_count )
+void bb_skip( BITBUFFER *bb, size_t i_count )
 {
     bb->i_left -= i_count;
 
@@ -194,10 +194,10 @@ void bb_skip( BITBUFFER *bb, ssize_t i_count )
     }
 }
 
-void bs_skip( BITSTREAM *bs, ssize_t i_count )
+void bs_skip( BITSTREAM *bs, size_t i_count )
 {
     int left;
-    int bytes = i_count >> 3;
+    size_t bytes = i_count >> 3;
 
     if (bs->bb.p + bytes >= bs->bb.p_end) {
         bs->pos = bs->pos + (bs->bb.p - bs->bb.p_start);
diff --git a/src/util/bits.h b/src/util/bits.h
index 62ab496..2ba2114 100644
--- a/src/util/bits.h
+++ b/src/util/bits.h
@@ -59,8 +59,8 @@ BD_PRIVATE void bb_init( BITBUFFER *bb, const uint8_t *p_data, size_t i_data );
 BD_PRIVATE void bs_init( BITSTREAM *bs, BD_FILE_H *fp );
 BD_PRIVATE void bb_seek( BITBUFFER *bb, int64_t off, int whence);
 BD_PRIVATE void bs_seek( BITSTREAM *bs, int64_t off, int whence);
-BD_PRIVATE void bb_skip( BITBUFFER *bb, ssize_t i_count );
-BD_PRIVATE void bs_skip( BITSTREAM *bs, ssize_t i_count );
+BD_PRIVATE void bb_skip( BITBUFFER *bb, size_t i_count );
+BD_PRIVATE void bs_skip( BITSTREAM *bs, size_t i_count );  /* note: i_count must be less than BF_BUF_SIZE */
 BD_PRIVATE uint32_t bb_read( BITBUFFER *bb, int i_count );
 BD_PRIVATE uint32_t bs_read( BITSTREAM *bs, int i_count );
 



More information about the libbluray-devel mailing list