1 /*
2 * SoX native format muxer
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 muxer
28 * @author Daniel Verkamp
29 * @see http://wiki.multimedia.cx/index.php?title=SoX_native_intermediate_format
30 */
31
39
43
45 {
50 size_t comment_len = 0, comment_size;
51
53 if (comment)
54 comment_len = strlen(comment->
value);
55 comment_size =
FFALIGN(comment_len, 8);
56
58
73 } else {
75 return -1;
76 }
77
78 if (comment_len)
80
81 ffio_fill(pb, 0, comment_size - comment_len);
82
84
85 return 0;
86 }
87
89 {
93
95 /* update number of samples */
97 int64_t num_samples = (file_size - sox->
header_size - 4LL) >> 2LL;
101 } else
104
106 }
107
108 return 0;
109 }
110
114 .extensions = "sox",
121 };