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
b0312eab
Commit
b0312eab
authored
Aug 15, 2012
by
Andrew Eikum
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mciavi32: Advance video frames based on frame duration, not audio sample rate.
parent
b522dc66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
23 deletions
+34
-23
mciavi.c
dlls/mciavi32/mciavi.c
+28
-17
mmoutput.c
dlls/mciavi32/mmoutput.c
+5
-5
private_mciavi.h
dlls/mciavi32/private_mciavi.h
+1
-1
No files found.
dlls/mciavi32/mciavi.c
View file @
b0312eab
...
...
@@ -391,19 +391,27 @@ static DWORD MCIAVI_mciPlay_async(WINE_MCIAVI *wma, DWORD dwFlags, LPMCI_PLAY_PA
return
0
;
}
static
double
currenttime_us
(
void
)
{
LARGE_INTEGER
lc
,
lf
;
QueryPerformanceCounter
(
&
lc
);
QueryPerformanceFrequency
(
&
lf
);
return
(
lc
.
QuadPart
*
1000000
)
/
lf
.
QuadPart
;
}
/***************************************************************************
* MCIAVI_mciPlay [internal]
*/
static
DWORD
MCIAVI_mciPlay
(
UINT
wDevID
,
DWORD
dwFlags
,
LPMCI_PLAY_PARMS
lpParms
)
{
WINE_MCIAVI
*
wma
;
DWORD
frameTime
;
DWORD
dwRet
;
LPWAVEHDR
waveHdr
=
NULL
;
unsigned
i
,
nHdr
=
0
;
DWORD
dwFromFrame
,
dwToFrame
;
DWORD
numEvents
=
1
;
HANDLE
events
[
2
];
double
next_frame_us
;
TRACE
(
"(%04x, %08X, %p)
\n
"
,
wDevID
,
dwFlags
,
lpParms
);
...
...
@@ -476,9 +484,6 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
if
(
dwFlags
&
(
MCI_DGV_PLAY_REPEAT
|
MCI_MCIAVI_PLAY_WINDOW
|
MCI_MCIAVI_PLAY_FULLSCREEN
))
FIXME
(
"Unsupported flag %08x
\n
"
,
dwFlags
);
/* time is in microseconds, we should convert it to milliseconds */
frameTime
=
(
wma
->
mah
.
dwMicroSecPerFrame
+
500
)
/
1000
;
events
[
0
]
=
wma
->
hStopEvent
;
if
(
wma
->
lpWaveFormat
)
{
if
(
MCIAVI_OpenAudio
(
wma
,
&
nHdr
,
&
waveHdr
)
!=
0
)
...
...
@@ -496,39 +501,45 @@ static DWORD MCIAVI_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
}
}
next_frame_us
=
currenttime_us
();
while
(
wma
->
dwStatus
==
MCI_MODE_PLAY
)
{
HDC
hDC
;
DWORD
tc
,
delta
;
double
tc
,
delta
;
DWORD
ret
;
tc
=
GetTickCount
();
tc
=
currenttime_us
();
hDC
=
wma
->
hWndPaint
?
GetDC
(
wma
->
hWndPaint
)
:
0
;
if
(
hDC
)
{
MCIAVI_PaintFrame
(
wma
,
hDC
);
while
(
next_frame_us
<=
tc
&&
wma
->
dwCurrVideoFrame
<
dwToFrame
){
double
dur
;
++
wma
->
dwCurrVideoFrame
;
dur
=
MCIAVI_PaintFrame
(
wma
,
hDC
);
if
(
!
dur
)
break
;
next_frame_us
+=
dur
;
TRACE
(
"next_frame: %f
\n
"
,
next_frame_us
);
}
ReleaseDC
(
wma
->
hWndPaint
,
hDC
);
}
if
(
wma
->
dwCurrVideoFrame
>=
dwToFrame
)
break
;
if
(
wma
->
lpWaveFormat
)
MCIAVI_PlayAudioBlocks
(
wma
,
nHdr
,
waveHdr
);
MCIAVI_PlayAudioBlocks
(
wma
,
nHdr
,
waveHdr
);
delta
=
GetTickCount
()
-
tc
;
if
(
delta
<
frameTime
)
delta
=
frameTime
-
delta
;
tc
=
currenttime_us
()
;
if
(
tc
<
next_frame_us
)
delta
=
next_frame_us
-
tc
;
else
delta
=
0
;
LeaveCriticalSection
(
&
wma
->
cs
);
ret
=
WaitForMultipleObjects
(
numEvents
,
events
,
FALSE
,
delta
);
ret
=
WaitForMultipleObjects
(
numEvents
,
events
,
FALSE
,
delta
/
1000
);
EnterCriticalSection
(
&
wma
->
cs
);
if
(
ret
==
WAIT_OBJECT_0
||
wma
->
dwStatus
!=
MCI_MODE_PLAY
)
break
;
if
(
wma
->
dwCurrVideoFrame
<
dwToFrame
)
wma
->
dwCurrVideoFrame
++
;
else
break
;
}
if
(
wma
->
lpWaveFormat
)
{
...
...
dlls/mciavi32/mmoutput.c
View file @
b0312eab
...
...
@@ -600,20 +600,20 @@ void MCIAVI_PlayAudioBlocks(WINE_MCIAVI* wma, unsigned nHdr, LPWAVEHDR waveHdr)
}
}
LRESULT
MCIAVI_PaintFrame
(
WINE_MCIAVI
*
wma
,
HDC
hDC
)
double
MCIAVI_PaintFrame
(
WINE_MCIAVI
*
wma
,
HDC
hDC
)
{
void
*
pBitmapData
;
LPBITMAPINFO
pBitmapInfo
;
if
(
!
hDC
||
!
wma
->
inbih
)
return
TRUE
;
return
0
;
TRACE
(
"Painting frame %u (cached %u)
\n
"
,
wma
->
dwCurrVideoFrame
,
wma
->
dwCachedFrame
);
if
(
wma
->
dwCurrVideoFrame
!=
wma
->
dwCachedFrame
)
{
if
(
!
wma
->
lpVideoIndex
[
wma
->
dwCurrVideoFrame
].
dwOffset
)
return
FALSE
;
return
0
;
if
(
wma
->
lpVideoIndex
[
wma
->
dwCurrVideoFrame
].
dwSize
)
{
...
...
@@ -626,7 +626,7 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC)
wma
->
outbih
,
wma
->
outdata
)
!=
ICERR_OK
)
{
WARN
(
"Decompression error
\n
"
);
return
FALSE
;
return
0
;
}
}
...
...
@@ -648,5 +648,5 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* wma, HDC hDC)
wma
->
source
.
right
-
wma
->
source
.
left
,
wma
->
source
.
bottom
-
wma
->
source
.
top
,
pBitmapData
,
pBitmapInfo
,
DIB_RGB_COLORS
,
SRCCOPY
);
return
TRUE
;
return
(
wma
->
ash_video
.
dwScale
/
(
double
)
wma
->
ash_video
.
dwRate
)
*
1000000
;
}
dlls/mciavi32/private_mciavi.h
View file @
b0312eab
...
...
@@ -96,7 +96,7 @@ BOOL MCIAVI_GetInfo(WINE_MCIAVI* wma) DECLSPEC_HIDDEN;
DWORD
MCIAVI_OpenAudio
(
WINE_MCIAVI
*
wma
,
unsigned
*
nHdr
,
LPWAVEHDR
*
pWaveHdr
)
DECLSPEC_HIDDEN
;
BOOL
MCIAVI_OpenVideo
(
WINE_MCIAVI
*
wma
)
DECLSPEC_HIDDEN
;
void
MCIAVI_PlayAudioBlocks
(
WINE_MCIAVI
*
wma
,
unsigned
nHdr
,
LPWAVEHDR
waveHdr
)
DECLSPEC_HIDDEN
;
LRESULT
MCIAVI_PaintFrame
(
WINE_MCIAVI
*
wma
,
HDC
hDC
)
DECLSPEC_HIDDEN
;
double
MCIAVI_PaintFrame
(
WINE_MCIAVI
*
wma
,
HDC
hDC
)
DECLSPEC_HIDDEN
;
/* mciavi.c */
WINE_MCIAVI
*
MCIAVI_mciGetOpenDev
(
UINT
wDevID
)
DECLSPEC_HIDDEN
;
...
...
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