Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6c1d089a
Commit
6c1d089a
authored
Mar 13, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Mar 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Detect and skip id3v2 header in mpeg splitter.
parent
e1867dac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
mpegsplit.c
dlls/quartz/mpegsplit.c
+27
-4
No files found.
dlls/quartz/mpegsplit.c
View file @
6c1d089a
...
@@ -337,7 +337,6 @@ static HRESULT MPEGSplitter_init_audio(MPEGSplitterImpl *This, const BYTE *heade
...
@@ -337,7 +337,6 @@ static HRESULT MPEGSplitter_init_audio(MPEGSplitterImpl *This, const BYTE *heade
mode_ext
=
((
header
[
3
]
>>
4
)
&
0x3
);
mode_ext
=
((
header
[
3
]
>>
4
)
&
0x3
);
emphasis
=
((
header
[
3
]
>>
0
)
&
0x3
);
emphasis
=
((
header
[
3
]
>>
0
)
&
0x3
);
pamt
->
cbFormat
=
((
layer
==
3
)
?
sizeof
(
MPEGLAYER3WAVEFORMAT
)
:
pamt
->
cbFormat
=
((
layer
==
3
)
?
sizeof
(
MPEGLAYER3WAVEFORMAT
)
:
sizeof
(
MPEG1WAVEFORMAT
));
sizeof
(
MPEG1WAVEFORMAT
));
pamt
->
pbFormat
=
CoTaskMemAlloc
(
pamt
->
cbFormat
);
pamt
->
pbFormat
=
CoTaskMemAlloc
(
pamt
->
cbFormat
);
...
@@ -431,7 +430,7 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin)
...
@@ -431,7 +430,7 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin)
ALLOCATOR_PROPERTIES
props
;
ALLOCATOR_PROPERTIES
props
;
HRESULT
hr
;
HRESULT
hr
;
LONGLONG
pos
=
0
;
/* in bytes */
LONGLONG
pos
=
0
;
/* in bytes */
BYTE
header
[
4
];
BYTE
header
[
10
];
int
streamtype
=
0
;
int
streamtype
=
0
;
LONGLONG
total
,
avail
;
LONGLONG
total
,
avail
;
AM_MEDIA_TYPE
amt
;
AM_MEDIA_TYPE
amt
;
...
@@ -440,15 +439,39 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin)
...
@@ -440,15 +439,39 @@ static HRESULT MPEGSplitter_pre_connect(IPin *iface, IPin *pConnectPin)
IAsyncReader_Length
(
pPin
->
pReader
,
&
total
,
&
avail
);
IAsyncReader_Length
(
pPin
->
pReader
,
&
total
,
&
avail
);
This
->
EndOfFile
=
total
;
This
->
EndOfFile
=
total
;
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
,
4
,
(
LPVOID
)
&
header
[
0
]
);
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
,
4
,
header
);
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
pos
+=
4
;
pos
+=
4
;
/* Skip ID3 v2 tag, if any */
if
(
SUCCEEDED
(
hr
)
&&
!
strncmp
(
"ID3"
,
(
char
*
)
header
,
3
))
do
{
UINT
length
;
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
,
6
,
header
+
4
);
if
(
FAILED
(
hr
))
break
;
pos
+=
6
;
TRACE
(
"Found ID3 v2.%d.%d
\n
"
,
header
[
3
],
header
[
4
]);
length
=
(
header
[
6
]
&
0x7F
)
<<
21
;
length
+=
(
header
[
7
]
&
0x7F
)
<<
14
;
length
+=
(
header
[
8
]
&
0x7F
)
<<
7
;
length
+=
(
header
[
9
]
&
0x7F
);
TRACE
(
"Length: %u
\n
"
,
length
);
pos
+=
length
;
/* Read the real header for the mpeg splitter */
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
,
4
,
header
);
if
(
SUCCEEDED
(
hr
))
pos
+=
4
;
TRACE
(
"%x:%x:%x:%x
\n
"
,
header
[
0
],
header
[
1
],
header
[
2
],
header
[
3
]);
}
while
(
0
);
while
(
SUCCEEDED
(
hr
)
&&
!
(
streamtype
=
MPEGSplitter_head_check
(
header
)))
while
(
SUCCEEDED
(
hr
)
&&
!
(
streamtype
=
MPEGSplitter_head_check
(
header
)))
{
{
TRACE
(
"%x:%x:%x:%x
\n
"
,
header
[
0
],
header
[
1
],
header
[
2
],
header
[
3
]);
/* No valid header yet; shift by a byte and check again */
/* No valid header yet; shift by a byte and check again */
memcpy
(
header
,
header
+
1
,
3
);
memcpy
(
header
,
header
+
1
,
3
);
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
++
,
1
,
(
LPVOID
)
&
header
[
3
]
);
hr
=
IAsyncReader_SyncRead
(
pPin
->
pReader
,
pos
++
,
1
,
header
+
3
);
}
}
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
return
hr
;
return
hr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment