qtdemux: don't use core API that doesn't exist yet
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 24 Sep 2009 18:33:39 +0000 (19:33 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Thu, 24 Sep 2009 18:33:39 +0000 (19:33 +0100)
There's no gst_byte_reader_has_remaining() yet. Fixes build.

gst/qtdemux/qtatomparser.h

index 292e3baf3e942fdc665d6d988b9facf811c43f94..f0fbbf6c76b513f4f57329f5df82e61f728f5235 100644 (file)
@@ -28,7 +28,13 @@ typedef GstByteReader QtAtomParser;
 
 #define qt_atom_parser_init gst_byte_reader_init
 #define qt_atom_parser_get_remaining gst_byte_reader_get_remaining
-#define qt_atom_parser_has_remaining gst_byte_reader_has_remaining
+
+static inline gboolean
+qt_atom_parser_has_remaining (QtAtomParser * parser, guint64 bytes_needed)
+{
+  return G_LIKELY (parser->size >= bytes_needed) &&
+      G_LIKELY ((parser->size - bytes_needed) >= parser->byte);
+}
 
 static inline gboolean
 qt_atom_parser_has_chunks (QtAtomParser * parser, guint32 n_chunks,