Mercurial > audlegacy-plugins
annotate src/aac/mp4ff/mp4atom.c @ 3065:a0ba6102131d
crossfade-ng: remove more cruft, kill some warnings.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Fri, 24 Apr 2009 06:38:48 -0500 |
parents | 3d6a2732f26a |
children | 90cdddf6f1c1 |
rev | line source |
---|---|
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
1 /* |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
3 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
4 ** |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
5 ** This program is free software; you can redistribute it and/or modify |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
6 ** it under the terms of the GNU General Public License as published by |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
7 ** the Free Software Foundation; either version 2 of the License, or |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
8 ** (at your option) any later version. |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
9 ** |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
10 ** This program is distributed in the hope that it will be useful, |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
13 ** GNU General Public License for more details. |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
14 ** |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
15 ** You should have received a copy of the GNU General Public License |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
16 ** along with this program; if not, write to the Free Software |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
18 ** |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
19 ** Any non-GPL usage of this software or parts of this software is strictly |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
20 ** forbidden. |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
21 ** |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
22 ** The "appropriate copyright message" mentioned in section 2c of the GPLv2 |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
23 ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com" |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
24 ** |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
25 ** Commercial non-GPL licensing of this software is possible. |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
26 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com. |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
27 ** |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
28 ** $Id: mp4atom.c,v 1.29 2009/01/19 23:56:30 menno Exp $ |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
29 **/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
30 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
31 #include <stdlib.h> |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
32 #include "mp4ffint.h" |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
33 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
34 #define COPYRIGHT_SYMBOL ((int8_t)0xA9) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
35 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
36 /* parse atom header size */ |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
37 static int32_t mp4ff_atom_get_size(const int8_t *data) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
38 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
39 uint32_t result; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
40 uint32_t a, b, c, d; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
41 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
42 a = (uint8_t)data[0]; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
43 b = (uint8_t)data[1]; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
44 c = (uint8_t)data[2]; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
45 d = (uint8_t)data[3]; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
46 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
47 result = (a<<24) | (b<<16) | (c<<8) | d; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
48 //if (result > 0 && result < 8) result = 8; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
49 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
50 return (int32_t)result; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
51 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
52 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
53 /* comnapre 2 atom names, returns 1 for equal, 0 for unequal */ |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
54 static int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1, const int8_t d1, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
55 const int8_t a2, const int8_t b2, const int8_t c2, const int8_t d2) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
56 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
57 if (a1 == a2 && b1 == b2 && c1 == c2 && d1 == d2) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
58 return 1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
59 else |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
60 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
61 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
62 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
63 static uint8_t mp4ff_atom_name_to_type(const int8_t a, const int8_t b, |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
64 const int8_t c, const int8_t d) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
65 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
66 if (a == 'm') |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
67 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
68 if (mp4ff_atom_compare(a,b,c,d, 'm','o','o','v')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
69 return ATOM_MOOV; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
70 else if (mp4ff_atom_compare(a,b,c,d, 'm','i','n','f')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
71 return ATOM_MINF; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
72 else if (mp4ff_atom_compare(a,b,c,d, 'm','d','i','a')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
73 return ATOM_MDIA; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
74 else if (mp4ff_atom_compare(a,b,c,d, 'm','d','a','t')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
75 return ATOM_MDAT; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
76 else if (mp4ff_atom_compare(a,b,c,d, 'm','d','h','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
77 return ATOM_MDHD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
78 else if (mp4ff_atom_compare(a,b,c,d, 'm','v','h','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
79 return ATOM_MVHD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
80 else if (mp4ff_atom_compare(a,b,c,d, 'm','p','4','a')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
81 return ATOM_MP4A; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
82 else if (mp4ff_atom_compare(a,b,c,d, 'm','p','4','v')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
83 return ATOM_MP4V; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
84 else if (mp4ff_atom_compare(a,b,c,d, 'm','p','4','s')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
85 return ATOM_MP4S; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
86 else if (mp4ff_atom_compare(a,b,c,d, 'm','e','t','a')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
87 return ATOM_META; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
88 } else if (a == 't') { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
89 if (mp4ff_atom_compare(a,b,c,d, 't','r','a','k')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
90 return ATOM_TRAK; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
91 else if (mp4ff_atom_compare(a,b,c,d, 't','k','h','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
92 return ATOM_TKHD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
93 else if (mp4ff_atom_compare(a,b,c,d, 't','r','e','f')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
94 return ATOM_TREF; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
95 else if (mp4ff_atom_compare(a,b,c,d, 't','r','k','n')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
96 return ATOM_TRACK; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
97 else if (mp4ff_atom_compare(a,b,c,d, 't','m','p','o')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
98 return ATOM_TEMPO; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
99 else if (mp4ff_atom_compare(a,b,c,d, 't','v','n','n')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
100 return ATOM_NETWORK; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
101 else if (mp4ff_atom_compare(a,b,c,d, 't','v','s','h')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
102 return ATOM_SHOW; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
103 else if (mp4ff_atom_compare(a,b,c,d, 't','v','e','n')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
104 return ATOM_EPISODENAME; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
105 else if (mp4ff_atom_compare(a,b,c,d, 't','v','s','n')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
106 return ATOM_SEASON; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
107 else if (mp4ff_atom_compare(a,b,c,d, 't','v','e','s')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
108 return ATOM_EPISODE; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
109 } else if (a == 's') { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
110 if (mp4ff_atom_compare(a,b,c,d, 's','t','b','l')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
111 return ATOM_STBL; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
112 else if (mp4ff_atom_compare(a,b,c,d, 's','m','h','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
113 return ATOM_SMHD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
114 else if (mp4ff_atom_compare(a,b,c,d, 's','t','s','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
115 return ATOM_STSD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
116 else if (mp4ff_atom_compare(a,b,c,d, 's','t','t','s')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
117 return ATOM_STTS; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
118 else if (mp4ff_atom_compare(a,b,c,d, 's','t','c','o')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
119 return ATOM_STCO; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
120 else if (mp4ff_atom_compare(a,b,c,d, 's','t','s','c')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
121 return ATOM_STSC; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
122 else if (mp4ff_atom_compare(a,b,c,d, 's','t','s','z')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
123 return ATOM_STSZ; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
124 else if (mp4ff_atom_compare(a,b,c,d, 's','t','z','2')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
125 return ATOM_STZ2; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
126 else if (mp4ff_atom_compare(a,b,c,d, 's','k','i','p')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
127 return ATOM_SKIP; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
128 else if (mp4ff_atom_compare(a,b,c,d, 's','i','n','f')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
129 return ATOM_SINF; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
130 else if (mp4ff_atom_compare(a,b,c,d, 's','c','h','i')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
131 return ATOM_SCHI; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
132 else if (mp4ff_atom_compare(a,b,c,d, 's','o','n','m')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
133 return ATOM_SORTTITLE; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
134 else if (mp4ff_atom_compare(a,b,c,d, 's','o','a','l')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
135 return ATOM_SORTALBUM; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
136 else if (mp4ff_atom_compare(a,b,c,d, 's','o','a','r')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
137 return ATOM_SORTARTIST; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
138 else if (mp4ff_atom_compare(a,b,c,d, 's','o','a','a')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
139 return ATOM_SORTALBUMARTIST; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
140 else if (mp4ff_atom_compare(a,b,c,d, 's','o','c','o')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
141 return ATOM_SORTWRITER; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
142 else if (mp4ff_atom_compare(a,b,c,d, 's','o','s','n')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
143 return ATOM_SORTSHOW; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
144 } else if (a == COPYRIGHT_SYMBOL) { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
145 if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'n','a','m')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
146 return ATOM_TITLE; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
147 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'A','R','T')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
148 return ATOM_ARTIST; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
149 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'w','r','t')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
150 return ATOM_WRITER; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
151 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'a','l','b')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
152 return ATOM_ALBUM; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
153 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'d','a','y')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
154 return ATOM_DATE; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
155 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'t','o','o')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
156 return ATOM_TOOL; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
157 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'c','m','t')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
158 return ATOM_COMMENT; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
159 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'g','e','n')) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
160 return ATOM_GENRE1; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
161 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'g','r','p')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
162 return ATOM_CONTENTGROUP; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
163 else if (mp4ff_atom_compare(a,b,c,d, COPYRIGHT_SYMBOL,'l','y','r')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
164 return ATOM_LYRICS; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
165 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
166 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
167 if (mp4ff_atom_compare(a,b,c,d, 'e','d','t','s')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
168 return ATOM_EDTS; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
169 else if (mp4ff_atom_compare(a,b,c,d, 'e','s','d','s')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
170 return ATOM_ESDS; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
171 else if (mp4ff_atom_compare(a,b,c,d, 'f','t','y','p')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
172 return ATOM_FTYP; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
173 else if (mp4ff_atom_compare(a,b,c,d, 'f','r','e','e')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
174 return ATOM_FREE; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
175 else if (mp4ff_atom_compare(a,b,c,d, 'h','m','h','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
176 return ATOM_HMHD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
177 else if (mp4ff_atom_compare(a,b,c,d, 'v','m','h','d')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
178 return ATOM_VMHD; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
179 else if (mp4ff_atom_compare(a,b,c,d, 'u','d','t','a')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
180 return ATOM_UDTA; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
181 else if (mp4ff_atom_compare(a,b,c,d, 'i','l','s','t')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
182 return ATOM_ILST; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
183 else if (mp4ff_atom_compare(a,b,c,d, 'n','a','m','e')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
184 return ATOM_NAME; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
185 else if (mp4ff_atom_compare(a,b,c,d, 'd','a','t','a')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
186 return ATOM_DATA; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
187 else if (mp4ff_atom_compare(a,b,c,d, 'd','i','s','k')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
188 return ATOM_DISC; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
189 else if (mp4ff_atom_compare(a,b,c,d, 'g','n','r','e')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
190 return ATOM_GENRE2; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
191 else if (mp4ff_atom_compare(a,b,c,d, 'c','o','v','r')) |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
192 return ATOM_COVER; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
193 else if (mp4ff_atom_compare(a,b,c,d, 'c','p','i','l')) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
194 return ATOM_COMPILATION; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
195 else if (mp4ff_atom_compare(a,b,c,d, 'c','t','t','s')) |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
196 return ATOM_CTTS; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
197 else if (mp4ff_atom_compare(a,b,c,d, 'd','r','m','s')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
198 return ATOM_DRMS; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
199 else if (mp4ff_atom_compare(a,b,c,d, 'f','r','m','a')) |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
200 return ATOM_FRMA; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
201 else if (mp4ff_atom_compare(a,b,c,d, 'p','r','i','v')) |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
202 return ATOM_PRIV; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
203 else if (mp4ff_atom_compare(a,b,c,d, 'i','v','i','v')) |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
204 return ATOM_IVIV; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
205 else if (mp4ff_atom_compare(a,b,c,d, 'u','s','e','r')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
206 return ATOM_USER; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
207 else if (mp4ff_atom_compare(a,b,c,d, 'k','e','y',' ')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
208 return ATOM_KEY; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
209 else if (mp4ff_atom_compare(a,b,c,d, 'a','A','R','T')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
210 return ATOM_ALBUM_ARTIST; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
211 else if (mp4ff_atom_compare(a,b,c,d, 'd','e','s','c')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
212 return ATOM_DESCRIPTION; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
213 else if (mp4ff_atom_compare(a,b,c,d, 'p','c','s','t')) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
214 return ATOM_PODCAST; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
215 else |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
216 return ATOM_UNKNOWN; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
217 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
218 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
219 /* read atom header, return atom size, atom size is with header included */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
220 uint64_t mp4ff_atom_read_header(mp4ff_t *f, uint8_t *atom_type, uint8_t *header_size) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
221 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
222 uint64_t size; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
223 int32_t ret; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
224 int8_t atom_header[8]; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
225 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
226 ret = mp4ff_read_data(f, atom_header, 8); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
227 if (ret != 8) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
228 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
229 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
230 size = mp4ff_atom_get_size(atom_header); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
231 *header_size = 8; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
232 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
233 /* check for 64 bit atom size */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
234 if (size == 1) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
235 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
236 *header_size = 16; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
237 size = mp4ff_read_int64(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
238 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
239 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
240 //printf("%c%c%c%c\n", atom_header[4], atom_header[5], atom_header[6], atom_header[7]); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
241 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
242 *atom_type = mp4ff_atom_name_to_type(atom_header[4], atom_header[5], atom_header[6], atom_header[7]); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
243 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
244 return size; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
245 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
246 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
247 static int32_t mp4ff_read_stsz(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
248 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
249 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
250 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
251 f->track[f->total_tracks - 1]->stsz_sample_size = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
252 f->track[f->total_tracks - 1]->stsz_sample_count = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
253 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
254 if (f->track[f->total_tracks - 1]->stsz_sample_size == 0) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
255 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
256 int32_t i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
257 f->track[f->total_tracks - 1]->stsz_table = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
258 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsz_sample_count*sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
259 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
260 for (i = 0; i < f->track[f->total_tracks - 1]->stsz_sample_count; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
261 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
262 f->track[f->total_tracks - 1]->stsz_table[i] = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
263 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
264 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
265 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
266 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
267 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
268 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
269 static int32_t mp4ff_read_esds(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
270 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
271 uint8_t tag; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
272 uint32_t temp; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
273 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
274 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
275 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
276 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
277 /* get and verify ES_DescrTag */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
278 tag = mp4ff_read_char(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
279 if (tag == 0x03) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
280 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
281 /* read length */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
282 if (mp4ff_read_mp4_descr_length(f) < 5 + 15) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
283 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
284 return 1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
285 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
286 /* skip 3 bytes */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
287 mp4ff_read_int24(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
288 } else { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
289 /* skip 2 bytes */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
290 mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
291 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
292 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
293 /* get and verify DecoderConfigDescrTab */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
294 if (mp4ff_read_char(f) != 0x04) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
295 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
296 return 1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
297 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
298 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
299 /* read length */ |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
300 temp = mp4ff_read_mp4_descr_length(f); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
301 if (temp < 13) return 1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
302 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
303 f->track[f->total_tracks - 1]->audioType = mp4ff_read_char(f); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
304 mp4ff_read_int32(f);//0x15000414 ???? |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
305 f->track[f->total_tracks - 1]->maxBitrate = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
306 f->track[f->total_tracks - 1]->avgBitrate = mp4ff_read_int32(f); |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
307 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
308 /* get and verify DecSpecificInfoTag */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
309 if (mp4ff_read_char(f) != 0x05) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
310 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
311 return 1; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
312 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
313 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
314 /* read length */ |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
315 f->track[f->total_tracks - 1]->decoderConfigLen = mp4ff_read_mp4_descr_length(f); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
316 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
317 if (f->track[f->total_tracks - 1]->decoderConfig) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
318 free(f->track[f->total_tracks - 1]->decoderConfig); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
319 f->track[f->total_tracks - 1]->decoderConfig = malloc(f->track[f->total_tracks - 1]->decoderConfigLen); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
320 if (f->track[f->total_tracks - 1]->decoderConfig) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
321 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
322 mp4ff_read_data(f, f->track[f->total_tracks - 1]->decoderConfig, f->track[f->total_tracks - 1]->decoderConfigLen); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
323 } else { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
324 f->track[f->total_tracks - 1]->decoderConfigLen = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
325 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
326 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
327 /* will skip the remainder of the atom */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
328 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
329 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
330 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
331 static int32_t mp4ff_read_mp4a(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
332 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
333 uint64_t size; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
334 int32_t i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
335 uint8_t atom_type = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
336 uint8_t header_size = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
337 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
338 for (i = 0; i < 6; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
339 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
340 mp4ff_read_char(f); /* reserved */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
341 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
342 /* data_reference_index */ mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
343 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
344 mp4ff_read_int32(f); /* reserved */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
345 mp4ff_read_int32(f); /* reserved */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
346 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
347 f->track[f->total_tracks - 1]->channelCount = mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
348 f->track[f->total_tracks - 1]->sampleSize = mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
349 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
350 mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
351 mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
352 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
353 f->track[f->total_tracks - 1]->sampleRate = mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
354 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
355 mp4ff_read_int16(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
356 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
357 size = mp4ff_atom_read_header(f, &atom_type, &header_size); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
358 if (atom_type == ATOM_ESDS) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
359 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
360 mp4ff_read_esds(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
361 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
362 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
363 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
364 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
365 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
366 static int32_t mp4ff_read_stsd(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
367 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
368 int32_t i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
369 uint8_t header_size = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
370 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
371 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
372 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
373 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
374 f->track[f->total_tracks - 1]->stsd_entry_count = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
375 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
376 for (i = 0; i < f->track[f->total_tracks - 1]->stsd_entry_count; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
377 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
378 uint64_t skip = mp4ff_position(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
379 uint64_t size; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
380 uint8_t atom_type = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
381 size = mp4ff_atom_read_header(f, &atom_type, &header_size); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
382 skip += size; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
383 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
384 if (atom_type == ATOM_MP4A) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
385 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
386 f->track[f->total_tracks - 1]->type = TRACK_AUDIO; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
387 mp4ff_read_mp4a(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
388 } else if (atom_type == ATOM_MP4V) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
389 f->track[f->total_tracks - 1]->type = TRACK_VIDEO; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
390 } else if (atom_type == ATOM_MP4S) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
391 f->track[f->total_tracks - 1]->type = TRACK_SYSTEM; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
392 } else { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
393 f->track[f->total_tracks - 1]->type = TRACK_UNKNOWN; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
394 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
395 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
396 mp4ff_set_position(f, skip); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
397 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
398 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
399 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
400 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
401 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
402 static int32_t mp4ff_read_stsc(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
403 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
404 int32_t i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
405 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
406 mp4ff_read_char(f); /* version */ |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
407 mp4ff_read_int24(f); /* flags */ |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
408 f->track[f->total_tracks - 1]->stsc_entry_count = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
409 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
410 f->track[f->total_tracks - 1]->stsc_first_chunk = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
411 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsc_entry_count*sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
412 f->track[f->total_tracks - 1]->stsc_samples_per_chunk = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
413 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsc_entry_count*sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
414 f->track[f->total_tracks - 1]->stsc_sample_desc_index = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
415 (int32_t*)malloc(f->track[f->total_tracks - 1]->stsc_entry_count*sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
416 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
417 for (i = 0; i < f->track[f->total_tracks - 1]->stsc_entry_count; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
418 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
419 f->track[f->total_tracks - 1]->stsc_first_chunk[i] = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
420 f->track[f->total_tracks - 1]->stsc_samples_per_chunk[i] = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
421 f->track[f->total_tracks - 1]->stsc_sample_desc_index[i] = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
422 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
423 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
424 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
425 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
426 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
427 static int32_t mp4ff_read_stco(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
428 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
429 int32_t i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
430 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
431 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
432 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
433 f->track[f->total_tracks - 1]->stco_entry_count = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
434 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
435 f->track[f->total_tracks - 1]->stco_chunk_offset = |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
436 (int32_t*)malloc(f->track[f->total_tracks - 1]->stco_entry_count*sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
437 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
438 for (i = 0; i < f->track[f->total_tracks - 1]->stco_entry_count; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
439 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
440 f->track[f->total_tracks - 1]->stco_chunk_offset[i] = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
441 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
442 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
443 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
444 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
445 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
446 static int32_t mp4ff_read_ctts(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
447 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
448 int32_t i; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
449 mp4ff_track_t * p_track = f->track[f->total_tracks - 1]; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
450 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
451 if (p_track->ctts_entry_count) return 0; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
452 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
453 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
454 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
455 p_track->ctts_entry_count = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
456 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
457 p_track->ctts_sample_count = (int32_t*)malloc(p_track->ctts_entry_count * sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
458 p_track->ctts_sample_offset = (int32_t*)malloc(p_track->ctts_entry_count * sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
459 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
460 if (p_track->ctts_sample_count == 0 || p_track->ctts_sample_offset == 0) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
461 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
462 if (p_track->ctts_sample_count) {free(p_track->ctts_sample_count);p_track->ctts_sample_count=0;} |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
463 if (p_track->ctts_sample_offset) {free(p_track->ctts_sample_offset);p_track->ctts_sample_offset=0;} |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
464 p_track->ctts_entry_count = 0; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
465 return 0; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
466 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
467 else |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
468 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
469 for (i = 0; i < f->track[f->total_tracks - 1]->ctts_entry_count; i++) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
470 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
471 p_track->ctts_sample_count[i] = mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
472 p_track->ctts_sample_offset[i] = mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
473 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
474 return 1; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
475 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
476 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
477 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
478 static int32_t mp4ff_read_stts(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
479 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
480 int32_t i; |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
481 mp4ff_track_t * p_track = f->track[f->total_tracks - 1]; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
482 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
483 if (p_track->stts_entry_count) return 0; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
484 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
485 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
486 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
487 p_track->stts_entry_count = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
488 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
489 p_track->stts_sample_count = (int32_t*)malloc(p_track->stts_entry_count * sizeof(int32_t)); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
490 p_track->stts_sample_delta = (int32_t*)malloc(p_track->stts_entry_count * sizeof(int32_t)); |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
491 |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
492 if (p_track->stts_sample_count == 0 || p_track->stts_sample_delta == 0) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
493 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
494 if (p_track->stts_sample_count) {free(p_track->stts_sample_count);p_track->stts_sample_count=0;} |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
495 if (p_track->stts_sample_delta) {free(p_track->stts_sample_delta);p_track->stts_sample_delta=0;} |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
496 p_track->stts_entry_count = 0; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
497 return 0; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
498 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
499 else |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
500 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
501 for (i = 0; i < f->track[f->total_tracks - 1]->stts_entry_count; i++) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
502 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
503 p_track->stts_sample_count[i] = mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
504 p_track->stts_sample_delta[i] = mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
505 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
506 return 1; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
507 } |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
508 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
509 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
510 static int32_t mp4ff_read_mvhd(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
511 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
512 int32_t i; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
513 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
514 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
515 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
516 /* creation_time */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
517 /* modification_time */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
518 f->time_scale = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
519 f->duration = mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
520 /* preferred_rate */ mp4ff_read_int32(f); /*mp4ff_read_fixed32(f);*/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
521 /* preferred_volume */ mp4ff_read_int16(f); /*mp4ff_read_fixed16(f);*/ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
522 for (i = 0; i < 10; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
523 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
524 /* reserved */ mp4ff_read_char(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
525 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
526 for (i = 0; i < 9; i++) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
527 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
528 mp4ff_read_int32(f); /* matrix */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
529 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
530 /* preview_time */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
531 /* preview_duration */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
532 /* poster_time */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
533 /* selection_time */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
534 /* selection_duration */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
535 /* current_time */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
536 /* next_track_id */ mp4ff_read_int32(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
537 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
538 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
539 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
540 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
541 #if 0 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
542 static int32_t mp4ff_read_tkhd(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
543 { |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
544 uint8_t version; |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
545 uint32_t flags; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
546 version = mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
547 flags = mp4ff_read_int24(f); /* flags */ |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
548 if (version==1) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
549 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
550 mp4ff_read_int64(f);//creation-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
551 mp4ff_read_int64(f);//modification-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
552 mp4ff_read_int32(f);//track-id |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
553 mp4ff_read_int32(f);//reserved |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
554 f->track[f->total_tracks - 1]->duration = mp4ff_read_int64(f);//duration |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
555 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
556 else //version == 0 |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
557 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
558 mp4ff_read_int32(f);//creation-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
559 mp4ff_read_int32(f);//modification-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
560 mp4ff_read_int32(f);//track-id |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
561 mp4ff_read_int32(f);//reserved |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
562 f->track[f->total_tracks - 1]->duration = mp4ff_read_int32(f);//duration |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
563 if (f->track[f->total_tracks - 1]->duration == 0xFFFFFFFF) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
564 f->track[f->total_tracks - 1]->duration = 0xFFFFFFFFFFFFFFFF; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
565 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
566 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
567 mp4ff_read_int32(f);//reserved |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
568 mp4ff_read_int32(f);//reserved |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
569 mp4ff_read_int16(f);//layer |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
570 mp4ff_read_int16(f);//pre-defined |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
571 mp4ff_read_int16(f);//volume |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
572 mp4ff_read_int16(f);//reserved |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
573 |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
574 //matrix |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
575 mp4ff_read_int32(f); mp4ff_read_int32(f); mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
576 mp4ff_read_int32(f); mp4ff_read_int32(f); mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
577 mp4ff_read_int32(f); mp4ff_read_int32(f); mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
578 mp4ff_read_int32(f);//width |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
579 mp4ff_read_int32(f);//height |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
580 return 1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
581 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
582 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
583 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
584 static int32_t mp4ff_read_mdhd(mp4ff_t *f) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
585 { |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
586 uint32_t version; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
587 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
588 version = mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
589 if (version==1) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
590 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
591 mp4ff_read_int64(f);//creation-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
592 mp4ff_read_int64(f);//modification-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
593 f->track[f->total_tracks - 1]->timeScale = mp4ff_read_int32(f);//timescale |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
594 f->track[f->total_tracks - 1]->duration = mp4ff_read_int64(f);//duration |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
595 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
596 else //version == 0 |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
597 { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
598 uint32_t temp; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
599 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
600 mp4ff_read_int32(f);//creation-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
601 mp4ff_read_int32(f);//modification-time |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
602 f->track[f->total_tracks - 1]->timeScale = mp4ff_read_int32(f);//timescale |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
603 temp = mp4ff_read_int32(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
604 f->track[f->total_tracks - 1]->duration = (temp == (uint32_t)(-1)) ? (uint64_t)(-1) : (uint64_t)(temp); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
605 } |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
606 mp4ff_read_int16(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
607 mp4ff_read_int16(f); |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
608 return 1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
609 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
610 #ifdef USE_TAGGING |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
611 static int32_t mp4ff_read_meta(mp4ff_t *f, const uint64_t size) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
612 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
613 uint64_t subsize, sumsize = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
614 uint8_t atom_type; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
615 uint8_t header_size = 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
616 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
617 mp4ff_read_char(f); /* version */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
618 mp4ff_read_int24(f); /* flags */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
619 |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
620 while (sumsize < (size-(header_size+4))) |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
621 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
622 subsize = mp4ff_atom_read_header(f, &atom_type, &header_size); |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
623 if (subsize <= header_size+4) |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
624 return 1; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
625 if (atom_type == ATOM_ILST) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
626 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
627 mp4ff_parse_metadata(f, (uint32_t)(subsize-(header_size+4))); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
628 } else { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
629 mp4ff_set_position(f, mp4ff_position(f)+subsize-header_size); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
630 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
631 sumsize += subsize; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
632 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
633 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
634 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
635 } |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
636 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
637 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
638 int32_t mp4ff_atom_read(mp4ff_t *f, const int32_t size, const uint8_t atom_type) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
639 { |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
640 uint64_t dest_position = mp4ff_position(f)+size-8; |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
641 if (atom_type == ATOM_STSZ) |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
642 { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
643 /* sample size box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
644 mp4ff_read_stsz(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
645 } else if (atom_type == ATOM_STTS) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
646 /* time to sample box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
647 mp4ff_read_stts(f); |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
648 } else if (atom_type == ATOM_CTTS) { |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
649 /* composition offset box */ |
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
650 mp4ff_read_ctts(f); |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
651 } else if (atom_type == ATOM_STSC) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
652 /* sample to chunk box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
653 mp4ff_read_stsc(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
654 } else if (atom_type == ATOM_STCO) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
655 /* chunk offset box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
656 mp4ff_read_stco(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
657 } else if (atom_type == ATOM_STSD) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
658 /* sample description box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
659 mp4ff_read_stsd(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
660 } else if (atom_type == ATOM_MVHD) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
661 /* movie header box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
662 mp4ff_read_mvhd(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
663 } else if (atom_type == ATOM_MDHD) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
664 /* track header */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
665 mp4ff_read_mdhd(f); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
666 #ifdef USE_TAGGING |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
667 } else if (atom_type == ATOM_META) { |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
668 /* iTunes Metadata box */ |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
669 mp4ff_read_meta(f, size); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
670 #endif |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
671 } |
3005
3d6a2732f26a
Update mp4ff as well. Eternal glory for the one who finds the hidden PACKAGE in the about dialog.
Tony Vroon <chainsaw@gentoo.org>
parents:
450
diff
changeset
|
672 |
0
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
673 mp4ff_set_position(f, dest_position); |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
674 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
675 |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
676 return 0; |
13389e613d67
[svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff
changeset
|
677 } |