Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
8099a624
Commit
8099a624
authored
Apr 30, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
May 01, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Get rid of the sample holding code in the wave parser.
parent
0f73bbad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
39 deletions
+6
-39
waveparser.c
dlls/quartz/waveparser.c
+6
-39
No files found.
dlls/quartz/waveparser.c
View file @
8099a624
...
@@ -42,7 +42,6 @@ static const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' ','p','i','n'
...
@@ -42,7 +42,6 @@ static const WCHAR wcsOutputPinName[] = {'o','u','t','p','u','t',' ','p','i','n'
typedef
struct
WAVEParserImpl
typedef
struct
WAVEParserImpl
{
{
ParserImpl
Parser
;
ParserImpl
Parser
;
IMediaSample
*
pCurrentSample
;
LONGLONG
StartOfFile
;
/* in media time */
LONGLONG
StartOfFile
;
/* in media time */
LONGLONG
EndOfFile
;
LONGLONG
EndOfFile
;
DWORD
dwSampleSize
;
DWORD
dwSampleSize
;
...
@@ -97,28 +96,6 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR
...
@@ -97,28 +96,6 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR
pOutputPin
=
(
Parser_OutputPin
*
)
This
->
Parser
.
ppPins
[
1
];
pOutputPin
=
(
Parser_OutputPin
*
)
This
->
Parser
.
ppPins
[
1
];
/* Try to get rid of the current sample in case we had a S_FALSE last time */
if
(
This
->
pCurrentSample
)
{
Parser_OutputPin
*
pOutputPin
=
(
Parser_OutputPin
*
)
This
->
Parser
.
ppPins
[
1
];
IMediaSample
*
pCurrentSample
=
This
->
pCurrentSample
;
/* Requeue buffer */
hr
=
OutputPin_SendSample
(
&
pOutputPin
->
pin
,
pCurrentSample
);
if
(
hr
!=
S_OK
)
{
Sleep
(
10
);
TRACE
(
"Requeueing!
\n
"
);
IMediaSample_AddRef
(
pSample
);
IAsyncReader_Request
(
This
->
Parser
.
pInputPin
->
pReader
,
pSample
,
0
);
return
hr
;
}
IMediaSample_Release
(
This
->
pCurrentSample
);
This
->
pCurrentSample
=
NULL
;
}
if
(
SUCCEEDED
(
hr
))
if
(
SUCCEEDED
(
hr
))
hr
=
IMemAllocator_GetBuffer
(
pin
->
pAlloc
,
&
newsample
,
NULL
,
NULL
,
0
);
hr
=
IMemAllocator_GetBuffer
(
pin
->
pAlloc
,
&
newsample
,
NULL
,
NULL
,
0
);
...
@@ -156,18 +133,14 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR
...
@@ -156,18 +133,14 @@ static HRESULT WAVEParser_Sample(LPVOID iface, IMediaSample * pSample, DWORD_PTR
IMediaSample_SetTime
(
pSample
,
&
tAviStart
,
&
tAviStop
);
IMediaSample_SetTime
(
pSample
,
&
tAviStart
,
&
tAviStop
);
hr
=
OutputPin_SendSample
(
&
pOutputPin
->
pin
,
pSample
);
hr
=
OutputPin_SendSample
(
&
pOutputPin
->
pin
,
pSample
);
if
(
hr
!=
S_OK
&&
hr
!=
VFW_E_NOT_CONNECTED
&&
hr
!=
S_FALS
E
)
if
(
hr
!=
S_OK
&&
hr
!=
S_FALSE
&&
hr
!=
VFW_E_WRONG_STAT
E
)
ERR
(
"Error sending sample (%x)
\n
"
,
hr
);
ERR
(
"Error sending sample (%x)
\n
"
,
hr
);
else
if
(
hr
!=
S_OK
)
if
(
hr
==
S_FALSE
)
/* Unset progression if denied! */
{
This
->
Parser
.
pInputPin
->
rtCurrent
=
tStart
;
This
->
pCurrentSample
=
pSample
;
IMediaSample_AddRef
(
pSample
);
hr
=
S_OK
;
}
}
}
if
(
tStop
>=
This
->
EndOfFile
||
(
bytepos_to_duration
(
This
,
tStop
)
>=
This
->
Parser
.
mediaSeeking
.
llStop
))
if
(
tStop
>=
This
->
EndOfFile
||
(
bytepos_to_duration
(
This
,
tStop
)
>=
This
->
Parser
.
mediaSeeking
.
llStop
)
||
hr
==
VFW_E_NOT_CONNECTED
)
{
{
int
i
;
int
i
;
...
@@ -338,7 +311,7 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
...
@@ -338,7 +311,7 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
props
->
cbAlign
=
((
WAVEFORMATEX
*
)
amt
.
pbFormat
)
->
nBlockAlign
;
props
->
cbAlign
=
((
WAVEFORMATEX
*
)
amt
.
pbFormat
)
->
nBlockAlign
;
props
->
cbPrefix
=
0
;
props
->
cbPrefix
=
0
;
props
->
cbBuffer
=
4096
;
props
->
cbBuffer
=
4096
;
props
->
cBuffers
=
2
;
props
->
cBuffers
=
3
;
pWAVEParser
->
dwSampleSize
=
((
WAVEFORMATEX
*
)
amt
.
pbFormat
)
->
nBlockAlign
;
pWAVEParser
->
dwSampleSize
=
((
WAVEFORMATEX
*
)
amt
.
pbFormat
)
->
nBlockAlign
;
IAsyncReader_Length
(
This
->
pReader
,
&
length
,
&
avail
);
IAsyncReader_Length
(
This
->
pReader
,
&
length
,
&
avail
);
pWAVEParser
->
dwLength
=
length
/
(
ULONGLONG
)
pWAVEParser
->
dwSampleSize
;
pWAVEParser
->
dwLength
=
length
/
(
ULONGLONG
)
pWAVEParser
->
dwSampleSize
;
...
@@ -364,10 +337,6 @@ static HRESULT WAVEParser_Cleanup(LPVOID iface)
...
@@ -364,10 +337,6 @@ static HRESULT WAVEParser_Cleanup(LPVOID iface)
TRACE
(
"(%p)->()
\n
"
,
This
);
TRACE
(
"(%p)->()
\n
"
,
This
);
if
(
This
->
pCurrentSample
)
IMediaSample_Release
(
This
->
pCurrentSample
);
This
->
pCurrentSample
=
NULL
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -457,8 +426,6 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
...
@@ -457,8 +426,6 @@ HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv)
/* Note: This memory is managed by the transform filter once created */
/* Note: This memory is managed by the transform filter once created */
This
=
CoTaskMemAlloc
(
sizeof
(
WAVEParserImpl
));
This
=
CoTaskMemAlloc
(
sizeof
(
WAVEParserImpl
));
This
->
pCurrentSample
=
NULL
;
hr
=
Parser_Create
(
&
(
This
->
Parser
),
&
WAVEParser_Vtbl
,
&
CLSID_WAVEParser
,
WAVEParser_Sample
,
WAVEParser_QueryAccept
,
WAVEParser_InputPin_PreConnect
,
WAVEParser_Cleanup
,
WAVEParser_disconnect
,
WAVEParser_first_request
,
NULL
,
NULL
,
WAVEParserImpl_seek
,
NULL
);
hr
=
Parser_Create
(
&
(
This
->
Parser
),
&
WAVEParser_Vtbl
,
&
CLSID_WAVEParser
,
WAVEParser_Sample
,
WAVEParser_QueryAccept
,
WAVEParser_InputPin_PreConnect
,
WAVEParser_Cleanup
,
WAVEParser_disconnect
,
WAVEParser_first_request
,
NULL
,
NULL
,
WAVEParserImpl_seek
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
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