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
697a6459
Commit
697a6459
authored
Apr 05, 2009
by
Stefano Guidoni
Committed by
Alexandre Julliard
Apr 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemp3: Rounding block count up in mpeg3_streamsize.
parent
448ca846
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
mpegl3.c
dlls/winemp3.acm/mpegl3.c
+10
-6
No files found.
dlls/winemp3.acm/mpegl3.c
View file @
697a6459
...
...
@@ -490,8 +490,7 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_PCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_MPEGLAYER3
)
{
nblocks
=
(
adsi
->
pwfxDst
->
nAvgBytesPerSec
*
8
*
144
/
adsi
->
pwfxDst
->
nSamplesPerSec
);
nblocks
=
(
adss
->
cbDstLength
-
3002
-
nblocks
)
/
nblocks
;
nblocks
=
(
adss
->
cbDstLength
-
3000
)
/
(
DWORD
)(
adsi
->
pwfxDst
->
nAvgBytesPerSec
*
1152
/
adsi
->
pwfxDst
->
nSamplesPerSec
+
0
.
5
);
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
adss
->
cbSrcLength
=
nblocks
*
1152
*
adsi
->
pwfxSrc
->
nBlockAlign
;
...
...
@@ -502,7 +501,7 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
nblocks
=
adss
->
cbDstLength
/
(
adsi
->
pwfxDst
->
nBlockAlign
*
1152
);
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
adss
->
cbSrcLength
=
nblocks
*
(
DWORD
)(
adsi
->
pwfxSrc
->
nAvgBytesPerSec
*
8
*
144
/
adsi
->
pwfxSrc
->
nSamplesPerSec
);
adss
->
cbSrcLength
=
nblocks
*
(
DWORD
)(
adsi
->
pwfxSrc
->
nAvgBytesPerSec
*
1152
/
adsi
->
pwfxSrc
->
nSamplesPerSec
);
}
else
{
...
...
@@ -517,15 +516,20 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
nblocks
=
adss
->
cbSrcLength
/
(
adsi
->
pwfxSrc
->
nBlockAlign
*
1152
);
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
adss
->
cbDstLength
=
nblocks
*
(
DWORD
)(
adsi
->
pwfxDst
->
nAvgBytesPerSec
*
8
*
144
/
adsi
->
pwfxDst
->
nSamplesPerSec
);
if
(
adss
->
cbSrcLength
%
(
DWORD
)(
adsi
->
pwfxSrc
->
nBlockAlign
*
1152
))
/* Round block count up. */
nblocks
++
;
adss
->
cbDstLength
=
3000
+
nblocks
*
(
DWORD
)(
adsi
->
pwfxDst
->
nAvgBytesPerSec
*
1152
/
adsi
->
pwfxDst
->
nSamplesPerSec
+
0
.
5
);
}
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_MPEGLAYER3
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
nblocks
=
(
adsi
->
pwfxSrc
->
nAvgBytesPerSec
*
8
*
144
/
adsi
->
pwfxSrc
->
nSamplesPerSec
);
nblocks
=
(
adss
->
cbSrcLength
-
3002
-
nblocks
)
/
nblocks
;
nblocks
=
adss
->
cbSrcLength
/
(
DWORD
)(
adsi
->
pwfxSrc
->
nAvgBytesPerSec
*
1152
/
adsi
->
pwfxSrc
->
nSamplesPerSec
);
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
if
(
adss
->
cbSrcLength
%
(
DWORD
)(
adsi
->
pwfxSrc
->
nAvgBytesPerSec
*
1152
/
adsi
->
pwfxSrc
->
nSamplesPerSec
))
/* Round block count up. */
nblocks
++
;
adss
->
cbDstLength
=
nblocks
*
1152
*
adsi
->
pwfxDst
->
nBlockAlign
;
}
else
...
...
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