1 /*
2 * SoX native format demuxer
3 * Copyright (c) 2009 Daniel Verkamp <daniel@drv.nu>
4 *
5 * Based on libSoX sox-fmt.c
6 * Copyright (c) 2008 robs@users.sourceforge.net
7 *
8 * This file is part of FFmpeg.
9 *
10 * FFmpeg is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * FFmpeg is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with FFmpeg; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 */
24
25 /**
26 * @file
27 * SoX native format demuxer
28 * @author Daniel Verkamp
29 * @see http://wiki.multimedia.cx/index.php?title=SoX_native_intermediate_format
30 */
31
41
43 {
45 return 0;
47 return 0;
49 return 0;
51 }
52
54 {
56 unsigned header_size, comment_size;
57 double sample_rate, sample_rate_frac;
60
62 if (!st)
64
66
74 } else {
81 }
82
84
88 }
89
90 if (sample_rate <= 0 || sample_rate > INT_MAX) {
93 }
94
95 sample_rate_frac = sample_rate -
floor(sample_rate);
96 if (sample_rate_frac)
98 "truncating fractional part of sample rate (%f)\n",
99 sample_rate_frac);
100
101 if ((header_size + 4) & 7 || header_size <
SOX_FIXED_HDR + comment_size
105 }
106
107 if (comment_size && comment_size < UINT_MAX) {
114 }
116
119 }
120
122
130
132
133 return 0;
134 }
135
143 };