Adds another safeguard to ensure AC3 pass-thru uses a 48khz sample rate.
[HandBrake.git] / contrib / patch_mpeg4ip_cygwin.patch
blob0bc19cda6d88a3ab1bb4ce1622bc719e1892af7d
1 diff -Naur mpeg4ip/lib/mp4v2/mp4.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.cpp
2 --- mpeg4ip/lib/mp4v2/mp4.cpp 2005-03-30 20:41:58.000000000 +0200
3 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.cpp 2007-02-09 22:39:28.000000000 +0100
4 @@ -1678,9 +1678,9 @@
5 extern "C" bool MP4GetTrackH264SeqPictHeaders (MP4FileHandle hFile,
6 MP4TrackId trackId,
7 uint8_t ***pSeqHeader,
8 - uint32_t **pSeqHeaderSize,
9 + u_int32_t **pSeqHeaderSize,
10 uint8_t ***pPictHeader,
11 - uint32_t **pPictHeaderSize)
12 + u_int32_t **pPictHeaderSize)
14 if (MP4_IS_VALID_FILE_HANDLE(hFile)) {
15 try {
16 diff -Naur mpeg4ip/lib/mp4v2/mp4.h /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.h
17 --- mpeg4ip/lib/mp4v2/mp4.h 2005-03-30 20:41:58.000000000 +0200
18 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4.h 2007-02-09 22:39:42.000000000 +0100
19 @@ -631,9 +631,9 @@
21 bool MP4GetTrackVideoMetadata(MP4FileHandle hFile,
22 MP4TrackId trackId,
23 - uint8_t **ppConfig,
24 - uint32_t *pConfigSize);
26 + u_int8_t **ppConfig,
27 + u_int32_t *pConfigSize);
29 bool MP4GetTrackESConfiguration(
30 MP4FileHandle hFile,
31 MP4TrackId trackId,
32 @@ -654,9 +654,9 @@
33 bool MP4GetTrackH264SeqPictHeaders(MP4FileHandle hFile,
34 MP4TrackId trackId,
35 uint8_t ***pSeqHeaders,
36 - uint32_t **pSeqHeaderSize,
37 + u_int32_t **pSeqHeaderSize,
38 uint8_t ***pPictHeader,
39 - uint32_t **pPictHeaderSize);
40 + u_int32_t **pPictHeaderSize);
41 bool MP4GetTrackH264LengthSize(MP4FileHandle hFile,
42 MP4TrackId trackId,
43 uint32_t *pLength);
44 diff -Naur mpeg4ip/lib/mp4v2/mp4container.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.cpp
45 --- mpeg4ip/lib/mp4v2/mp4container.cpp 2001-11-19 18:06:58.000000000 +0100
46 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.cpp 2007-02-09 22:10:23.000000000 +0100
47 @@ -207,7 +207,7 @@
48 u_int32_t numProperties = m_pProperties.Size();
50 if (numProperties == 0) {
51 - WARNING(numProperties == 0);
52 + //WARNING(numProperties == 0);
53 return;
56 diff -Naur mpeg4ip/lib/mp4v2/mp4container.h /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.h
57 --- mpeg4ip/lib/mp4v2/mp4container.h 2001-11-19 18:06:58.000000000 +0100
58 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4container.h 2007-02-09 22:06:42.000000000 +0100
59 @@ -1,24 +1,3 @@
60 -/*
61 - * The contents of this file are subject to the Mozilla Public
62 - * License Version 1.1 (the "License"); you may not use this file
63 - * except in compliance with the License. You may obtain a copy of
64 - * the License at http://www.mozilla.org/MPL/
65 - *
66 - * Software distributed under the License is distributed on an "AS
67 - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
68 - * implied. See the License for the specific language governing
69 - * rights and limitations under the License.
70 - *
71 - * The Original Code is MPEG4IP.
72 - *
73 - * The Initial Developer of the Original Code is Cisco Systems Inc.
74 - * Portions created by Cisco Systems Inc. are
75 - * Copyright (C) Cisco Systems Inc. 2001. All Rights Reserved.
76 - *
77 - * Contributor(s):
78 - * Dave Mackie dmackie@cisco.com
79 - */
81 #ifndef __MP4_CONTAINER_INCLUDED__
82 #define __MP4_CONTAINER_INCLUDED__
84 diff -Naur mpeg4ip/lib/mp4v2/mp4descriptor.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4descriptor.cpp
85 --- mpeg4ip/lib/mp4v2/mp4descriptor.cpp 2004-02-12 03:06:02.000000000 +0100
86 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4descriptor.cpp 2007-02-09 22:24:17.000000000 +0100
87 @@ -149,7 +149,7 @@
88 u_int32_t numProperties = m_pProperties.Size();
90 if (numProperties == 0) {
91 - WARNING(numProperties == 0);
92 + //WARNING(numProperties == 0);
93 return;
96 @@ -194,7 +194,7 @@
97 u_int32_t numProperties = m_pProperties.Size();
99 if (numProperties == 0) {
100 - WARNING(numProperties == 0);
101 + //WARNING(numProperties == 0);
102 return;
104 for (u_int32_t i = 0; i < numProperties; i++) {
105 diff -Naur mpeg4ip/lib/mp4v2/mp4file.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.cpp
106 --- mpeg4ip/lib/mp4v2/mp4file.cpp 2005-03-30 20:41:58.000000000 +0200
107 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.cpp 2007-02-09 22:44:08.000000000 +0100
108 @@ -1431,7 +1431,7 @@
109 return trackId;
112 -MP4TrackId MP4File::AddCntlTrackDefault (uint32_t timeScale,
113 +MP4TrackId MP4File::AddCntlTrackDefault (u_int32_t timeScale,
114 MP4Duration sampleDuration,
115 const char *type)
117 @@ -1682,7 +1682,7 @@
118 (MP4Property **)&pLength) == false) ||
119 (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetNALUnit",
120 (MP4Property **)&pUnit) == false)) {
121 - VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties"));
122 + //VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties"));
123 return false;
125 uint32_t count = pCount->GetValue();
126 @@ -1692,7 +1692,7 @@
127 for (uint32_t index = 0; index < count; index++) {
128 if (pLength->GetValue(index) == sequenceLen) {
129 uint8_t *seq;
130 - uint32_t seqlen;
131 + u_int32_t seqlen;
132 pUnit->GetValue(&seq, &seqlen, index);
133 if (memcmp(seq, pSequence, sequenceLen) == 0) {
134 free(seq);
135 @@ -1724,8 +1724,8 @@
136 (MP4Property **)&pLength) == false) ||
137 (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetNALUnit",
138 (MP4Property **)&pUnit) == false)) {
139 - VERBOSE_ERROR(m_verbosity,
140 - WARNING("Could not find avcC picture table properties"));
141 + //VERBOSE_ERROR(m_verbosity,
142 + //WARNING("Could not find avcC picture table properties"));
143 return false;
145 uint32_t count = pCount->GetValue();
146 @@ -1735,7 +1735,7 @@
147 for (uint32_t index = 0; index < count; index++) {
148 if (pLength->GetValue(index) == pictLen) {
149 uint8_t *seq;
150 - uint32_t seqlen;
151 + u_int32_t seqlen;
152 pUnit->GetValue(&seq, &seqlen, index);
153 if (memcmp(seq, pPict, pictLen) == 0) {
154 VERBOSE_WRITE(m_verbosity,
155 @@ -2472,9 +2472,9 @@
157 bool MP4File::GetTrackH264SeqPictHeaders (MP4TrackId trackId,
158 uint8_t ***pppSeqHeader,
159 - uint32_t **ppSeqHeaderSize,
160 + u_int32_t **ppSeqHeaderSize,
161 uint8_t ***pppPictHeader,
162 - uint32_t **ppPictHeaderSize)
163 + u_int32_t **ppPictHeaderSize)
165 uint32_t count;
167 @@ -2490,15 +2490,15 @@
168 (MP4Property **)&pSeqLen) == false) ||
169 (avcCAtom->FindProperty("avcC.sequenceEntries.sequenceParameterSetNALUnit",
170 (MP4Property **)&pSeqVal) == false)) {
171 - VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties"));
172 + //VERBOSE_ERROR(m_verbosity, WARNING("Could not find avcC properties"));
173 return false;
175 uint8_t **ppSeqHeader =
176 (uint8_t **)malloc((pSeqCount->GetValue() + 1) * sizeof(uint8_t *));
177 *pppSeqHeader = ppSeqHeader;
179 - uint32_t *pSeqHeaderSize =
180 - (uint32_t *)malloc((pSeqCount->GetValue() + 1) * sizeof(uint32_t *));
181 + u_int32_t *pSeqHeaderSize =
182 + (u_int32_t *)malloc((pSeqCount->GetValue() + 1) * sizeof(u_int32_t *));
184 *ppSeqHeaderSize = pSeqHeaderSize;
185 for (count = 0; count < pSeqCount->GetValue(); count++) {
186 @@ -2513,15 +2513,15 @@
187 (MP4Property **)&pPictLen) == false) ||
188 (avcCAtom->FindProperty("avcC.pictureEntries.pictureParameterSetNALUnit",
189 (MP4Property **)&pPictVal) == false)) {
190 - VERBOSE_ERROR(m_verbosity,
191 - WARNING("Could not find avcC picture table properties"));
192 + //VERBOSE_ERROR(m_verbosity,
193 + //WARNING("Could not find avcC picture table properties"));
194 return false;
196 uint8_t
197 **ppPictHeader =
198 (uint8_t **)malloc((pPictCount->GetValue() + 1) * sizeof(uint8_t *));
199 - uint32_t *pPictHeaderSize =
200 - (uint32_t *)malloc((pPictCount->GetValue() + 1)* sizeof(uint32_t *));
201 + u_int32_t *pPictHeaderSize =
202 + (u_int32_t *)malloc((pPictCount->GetValue() + 1)* sizeof(u_int32_t *));
203 *pppPictHeader = ppPictHeader;
204 *ppPictHeaderSize = pPictHeaderSize;
206 diff -Naur mpeg4ip/lib/mp4v2/mp4file.h /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.h
207 --- mpeg4ip/lib/mp4v2/mp4file.h 2005-03-30 20:41:58.000000000 +0200
208 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file.h 2007-02-09 22:35:21.000000000 +0100
209 @@ -329,9 +329,9 @@
210 uint8_t *pLevel);
211 bool GetTrackH264SeqPictHeaders(MP4TrackId trackId,
212 uint8_t ***pSeqHeader,
213 - uint32_t **pSeqHeaderSize,
214 + u_int32_t **pSeqHeaderSize,
215 uint8_t ***pPictHeader,
216 - uint32_t **pPictHeaderSize);
217 + u_int32_t **pPictHeaderSize);
218 void GetTrackH264LengthSize(MP4TrackId,
219 uint32_t *pLength);
220 const char* GetHintTrackSdp(MP4TrackId hintTrackId);
221 diff -Naur mpeg4ip/lib/mp4v2/mp4file_io.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file_io.cpp
222 --- mpeg4ip/lib/mp4v2/mp4file_io.cpp 2004-07-15 20:09:48.000000000 +0200
223 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4file_io.cpp 2007-02-09 22:44:47.000000000 +0100
224 @@ -86,7 +86,7 @@
227 ASSERT(pBytes);
228 - WARNING(m_numReadBits > 0);
229 + //WARNING(m_numReadBits > 0);
231 if (pFile == NULL) {
232 pFile = m_pFile;
233 diff -Naur mpeg4ip/lib/mp4v2/mp4property.cpp /Users/pri/t/mpeg4ip/lib/mp4v2/mp4property.cpp
234 --- mpeg4ip/lib/mp4v2/mp4property.cpp 2004-08-23 20:28:21.000000000 +0200
235 +++ /Users/pri/t/mpeg4ip/lib/mp4v2/mp4property.cpp 2007-02-09 22:47:04.000000000 +0100
236 @@ -636,7 +636,7 @@
237 u_int32_t numProperties = m_pProperties.Size();
239 if (numProperties == 0) {
240 - WARNING(numProperties == 0);
241 + //WARNING(numProperties == 0);
242 return;
245 @@ -670,7 +670,7 @@
246 u_int32_t numProperties = m_pProperties.Size();
248 if (numProperties == 0) {
249 - WARNING(numProperties == 0);
250 + //WARNING(numProperties == 0);
251 return;
254 @@ -709,7 +709,7 @@
255 u_int32_t numProperties = m_pProperties.Size();
257 if (numProperties == 0) {
258 - WARNING(numProperties == 0);
259 + //WARNING(numProperties == 0);
260 return;