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
b7e20bfd
Commit
b7e20bfd
authored
Apr 25, 2008
by
Maarten Lankhorst
Committed by
Alexandre Julliard
Apr 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
quartz: Fix time discontinuities in the acm wrapper.
parent
9e143cdb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
8 deletions
+34
-8
acmwrapper.c
dlls/quartz/acmwrapper.c
+34
-8
No files found.
dlls/quartz/acmwrapper.c
View file @
b7e20bfd
...
...
@@ -47,6 +47,9 @@ typedef struct ACMWrapperImpl
HACMSTREAM
has
;
LPWAVEFORMATEX
pWfIn
;
LPWAVEFORMATEX
pWfOut
;
LONGLONG
lasttime_real
;
LONGLONG
lasttime_sent
;
}
ACMWrapperImpl
;
static
HRESULT
ACMWrapper_ProcessSampleData
(
TransformFilterImpl
*
pTransformFilter
,
IMediaSample
*
pSample
)
...
...
@@ -75,6 +78,19 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte
IMediaSample_GetTime
(
pSample
,
&
tStart
,
&
tStop
);
cbSrcStream
=
IMediaSample_GetActualDataLength
(
pSample
);
/* Prevent discontinuities when codecs 'absorb' data but not give anything back in return */
if
(
IMediaSample_IsDiscontinuity
(
pSample
)
==
S_OK
)
{
This
->
lasttime_real
=
tStart
;
This
->
lasttime_sent
=
tStart
;
}
else
if
(
This
->
lasttime_real
==
tStart
)
tStart
=
This
->
lasttime_sent
;
else
WARN
(
"Discontinuity
\n
"
);
tMed
=
tStart
;
TRACE
(
"Sample data ptr = %p, size = %ld
\n
"
,
pbSrcStream
,
(
long
)
cbSrcStream
);
hr
=
IPin_ConnectionMediaType
(
This
->
tf
.
ppPins
[
0
],
&
amt
);
...
...
@@ -132,19 +148,20 @@ static HRESULT ACMWrapper_ProcessSampleData(TransformFilterImpl* pTransformFilte
if
(
res
)
{
if
(
res
!=
MMSYSERR_MOREDATA
)
ERR
(
"Cannot convert data header %d
\n
"
,
res
);
goto
error
;
}
if
(
res
!=
MMSYSERR_MOREDATA
)
ERR
(
"Cannot convert data header %d
\n
"
,
res
);
goto
error
;
}
TRACE
(
"used in %u/%u, used out %u/%u
\n
"
,
ash
.
cbSrcLengthUsed
,
ash
.
cbSrcLength
,
ash
.
cbDstLengthUsed
,
ash
.
cbDstLength
);
TRACE
(
"used in %u/%u, used out %u/%u
\n
"
,
ash
.
cbSrcLengthUsed
,
ash
.
cbSrcLength
,
ash
.
cbDstLengthUsed
,
ash
.
cbDstLength
);
hr
=
IMediaSample_SetActualDataLength
(
pOutSample
,
ash
.
cbDstLengthUsed
);
assert
(
hr
==
S_OK
);
hr
=
IMediaSample_SetActualDataLength
(
pOutSample
,
ash
.
cbDstLengthUsed
);
assert
(
hr
==
S_OK
);
/* Bug in acm codecs? It apparantly uses the input, but doesn't necessarily output immediately kl*/
if
(
!
ash
.
cbSrcLengthUsed
)
{
WARN
(
"Sample was skipped
\n
"
);
WARN
(
"Sample was skipped
? Outputted: %u
\n
"
,
ash
.
cbDstLengthUsed
);
ash
.
cbSrcLength
=
0
;
goto
error
;
}
...
...
@@ -187,8 +204,15 @@ error:
if
(
pOutSample
)
IMediaSample_Release
(
pOutSample
);
pOutSample
=
NULL
;
}
This
->
lasttime_real
=
tStop
;
This
->
lasttime_sent
=
tMed
;
if
(
hr
!=
S_OK
)
FIXME
(
"FATALITY: %08x
\n
"
,
hr
);
return
hr
;
}
...
...
@@ -252,6 +276,7 @@ static HRESULT ACMWrapper_Cleanup(TransformFilterImpl* pTransformFilter)
acmStreamClose
(
This
->
has
,
0
);
This
->
has
=
0
;
This
->
lasttime_real
=
This
->
lasttime_sent
=
-
1
;
return
S_OK
;
}
...
...
@@ -287,6 +312,7 @@ HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv)
return
hr
;
*
ppv
=
(
LPVOID
)
This
;
This
->
lasttime_real
=
This
->
lasttime_sent
=
-
1
;
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