summaryrefslogtreecommitdiff
path: root/src/demuxers/id3.h
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-03 01:41:16 +0000
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-03-03 01:41:16 +0000
commit5ff2be1b878d481cbfcce5f41a5fb679c45824ec (patch)
treeee605aafbdf130b5b7bfe8d7891a6632ff3969dc /src/demuxers/id3.h
parent6a16b385d3c32e412e23f9f5d44140d7afd9af79 (diff)
downloadxine-lib-5ff2be1b878d481cbfcce5f41a5fb679c45824ec.tar.gz
xine-lib-5ff2be1b878d481cbfcce5f41a5fb679c45824ec.tar.bz2
Add two extra functions (inline as they are just a return statement) that checks if a preamble is of an ID3v2 tag, and that calculate the size of the tag (to avoid repeating the same code over and over and over; the size of the shared object is reduced. Also make demux_flac use the id3.c functions to parse the eventual ID3 header.
CVS patchset: 8637 CVS date: 2007/03/03 01:41:16
Diffstat (limited to 'src/demuxers/id3.h')
-rw-r--r--src/demuxers/id3.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/demuxers/id3.h b/src/demuxers/id3.h
index 394488858..9d08f6817 100644
--- a/src/demuxers/id3.h
+++ b/src/demuxers/id3.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2003 the xine project
+ * Copyright (C) 2000-2007 the xine project
*
* This file is part of xine, a free video player.
*
@@ -21,7 +21,7 @@
*
* Supported versions: v1, v1.1, v2.2, v2.3, v2.4
*
- * $Id: id3.h,v 1.5 2007/03/03 00:58:52 dgp85 Exp $
+ * $Id: id3.h,v 1.6 2007/03/03 01:41:16 dgp85 Exp $
*/
#ifndef ID3_H
@@ -170,4 +170,19 @@ int id3v2_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
int8_t *mp3_frame_header);
+static inline int id3v2_istag(uint8_t *ptr) {
+ return
+ (ptr[0] == 'I') &&
+ (ptr[1] == 'D') &&
+ (ptr[2] == '3');
+}
+
+static inline uint32_t id3v2_tagsize(uint8_t *ptr) {
+ return
+ ((uint32_t)ptr[0] << 21) +
+ ((uint32_t)ptr[1] << 14) +
+ ((uint32_t)ptr[2] << 7) +
+ (uint32_t)ptr[3];
+}
+
#endif /* ID3_H */