On 03/01/16 01:35, Andreas Cadhalpun wrote:
This can be used to simplify code in a couple of places.

Signed-off-by: Andreas Cadhalpun <[email protected]>
---
  libavcodec/get_bits.h | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 0a61c80..f984d3e 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -269,6 +269,14 @@ static inline unsigned int get_bits(GetBitContext *s, int 
n)
      return tmp;
  }

+/**
+ * Read 0-25 bits.
+ */
+static inline int get_bitsz(GetBitContext *s, int n)
+{
+    return n ? get_bits(s, n) : 0;
+}
+
  static inline unsigned int get_bits_le(GetBitContext *s, int n)
  {
      register int tmp;


Seems fine to me and probably there isn't a better name.

lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to