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
21186d5a
Commit
21186d5a
authored
Mar 24, 2009
by
Stefano Guidoni
Committed by
Alexandre Julliard
Mar 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemp3: Fixed mpeg3_streamsize.
mpeg3_streamsize must estimate the number of samples of an mp3 chunk. The result must be block aligned (PCM) or frame aligned (MP3).
parent
5396fbf9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
mpegl3.c
dlls/winemp3.acm/mpegl3.c
+20
-8
No files found.
dlls/winemp3.acm/mpegl3.c
View file @
21186d5a
...
...
@@ -471,6 +471,8 @@ static LRESULT MPEG3_StreamClose(PACMDRVSTREAMINSTANCE adsi)
*/
static
LRESULT
MPEG3_StreamSize
(
PACMDRVSTREAMINSTANCE
adsi
,
PACMDRVSTREAMSIZE
adss
)
{
DWORD
nblocks
;
switch
(
adss
->
fdwSize
)
{
case
ACM_STREAMSIZEF_DESTINATION
:
...
...
@@ -478,14 +480,19 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_PCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_MPEGLAYER3
)
{
/* don't take block overhead into account, doesn't matter too much */
adss
->
cbSrcLength
=
adss
->
cbDstLength
*
12
;
nblocks
=
(
adsi
->
pwfxDst
->
nAvgBytesPerSec
*
8
*
144
/
adsi
->
pwfxDst
->
nSamplesPerSec
);
nblocks
=
(
adss
->
cbDstLength
-
3002
-
nblocks
)
/
nblocks
;
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
adss
->
cbSrcLength
=
nblocks
*
1152
*
adsi
->
pwfxSrc
->
nBlockAlign
;
}
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_MPEGLAYER3
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
FIXME
(
"misses the block header overhead
\n
"
);
adss
->
cbSrcLength
=
256
+
adss
->
cbDstLength
/
12
;
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
);
}
else
{
...
...
@@ -497,14 +504,19 @@ static LRESULT MPEG3_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE ad
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_PCM
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_MPEGLAYER3
)
{
FIXME
(
"misses the block header overhead
\n
"
);
adss
->
cbDstLength
=
256
+
adss
->
cbSrcLength
/
12
;
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
);
}
else
if
(
adsi
->
pwfxSrc
->
wFormatTag
==
WAVE_FORMAT_MPEGLAYER3
&&
adsi
->
pwfxDst
->
wFormatTag
==
WAVE_FORMAT_PCM
)
{
/* don't take block overhead into account, doesn't matter too much */
adss
->
cbDstLength
=
adss
->
cbSrcLength
*
12
;
nblocks
=
(
adsi
->
pwfxSrc
->
nAvgBytesPerSec
*
8
*
144
/
adsi
->
pwfxSrc
->
nSamplesPerSec
);
nblocks
=
(
adss
->
cbSrcLength
-
3002
-
nblocks
)
/
nblocks
;
if
(
nblocks
==
0
)
return
ACMERR_NOTPOSSIBLE
;
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