diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-08-25 12:11:28 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2009-09-24 16:32:02 +0100 |
commit | 0f197776e13a489a842f1efe5ca1274d185a81aa (patch) | |
tree | 93deafbb909109d9841bf759bc6673f1b24829f2 /gst/qtdemux/qtatomparser.h | |
parent | f65e6ea3a17f98b5bcf799a1c418198028b548a1 (diff) |
qtdemux: add qt_atom_parser_has_chunks() and fix indentation
Diffstat (limited to 'gst/qtdemux/qtatomparser.h')
-rw-r--r-- | gst/qtdemux/qtatomparser.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/qtdemux/qtatomparser.h b/gst/qtdemux/qtatomparser.h index 7669ec0f..4bf5409f 100644 --- a/gst/qtdemux/qtatomparser.h +++ b/gst/qtdemux/qtatomparser.h @@ -46,6 +46,15 @@ qt_atom_parser_has_remaining (QtAtomParser * parser, guint64 min_remaining) } static inline gboolean +qt_atom_parser_has_chunks (QtAtomParser * parser, guint32 n_chunks, + guint32 chunk_size) +{ + /* assumption: n_chunks and chunk_size are 32-bit, we cast to 64-bit here + * to avoid overflows, to handle e.g. (guint32)-1 * size correctly */ + return qt_atom_parser_has_remaining (parser, (guint64) n_chunks * chunk_size); +} + +static inline gboolean qt_atom_parser_skip (QtAtomParser * parser, guint nbytes) { if (G_UNLIKELY (qt_atom_parser_get_remaining (parser) < nbytes)) |