1 /*
2 * Maxis XA (.xa) File Demuxer
3 * Copyright (c) 2008 Robert Marston
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * Maxis XA File Demuxer
25 * by Robert Marston (rmarston@gmail.com)
26 * for more information on the XA audio format see
27 * http://wiki.multimedia.cx/index.php?title=Maxis_XA
28 */
29
33
34 #define XA00_TAG MKTAG('X', 'A', 0, 0)
35 #define XAI0_TAG MKTAG('X', 'A', 'I', 0)
36 #define XAJ0_TAG MKTAG('X', 'A', 'J', 0)
37
42
44 {
45 int channels, srate, bits_per_sample;
47 return 0;
52 break;
53 default:
54 return 0;
55 }
59 if (!channels || channels > 8 || !srate || srate > 192000 ||
60 bits_per_sample < 4 || bits_per_sample > 32)
61 return 0;
63 }
64
66 {
70
71 /*Set up the XA Audio Decoder*/
73 if (!st)
75
83 avio_skip(pb, 4);
/* Skip average byte rate */
85 avio_skip(pb, 2);
/* Skip bits-per-sample */
86
89
92
95
96 return 0;
97 }
98
101 {
105 unsigned int packet_size;
107
110 /* 1 byte header and 14 bytes worth of samples * number channels per block */
112
114 if(ret < 0)
116
120
122 }
123
131 };