Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
73bcce33
Commit
73bcce33
authored
Apr 03, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when converting from bps -> kbps, divide by 1000, not 1024
git-svn-id:
https://svn.musicpd.org/mpd/trunk@592
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
785cdb01
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
6 deletions
+6
-6
aac_decode.c
src/aac_decode.c
+1
-1
audiofile_decode.c
src/audiofile_decode.c
+1
-1
flac_decode.c
src/flac_decode.c
+1
-1
mp3_decode.c
src/mp3_decode.c
+1
-1
mp4_decode.c
src/mp4_decode.c
+1
-1
ogg_decode.c
src/ogg_decode.c
+1
-1
No files found.
src/aac_decode.c
View file @
73bcce33
...
...
@@ -357,7 +357,7 @@ int aac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if
(
sampleCount
>
0
)
{
bitRate
=
frameInfo
.
bytesconsumed
*
8
.
0
*
frameInfo
.
channels
*
sampleRate
/
frameInfo
.
samples
/
10
24
+
0
.
5
;
frameInfo
.
samples
/
10
00
+
0
.
5
;
time
+=
(
float
)(
frameInfo
.
samples
)
/
frameInfo
.
channels
/
sampleRate
;
}
...
...
src/audiofile_decode.c
View file @
73bcce33
...
...
@@ -79,7 +79,7 @@ int audiofile_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
cb
->
totalTime
=
((
float
)
frame_count
/
(
float
)
af
->
sampleRate
);
bitRate
=
st
.
st_size
*
8
.
0
/
cb
->
totalTime
/
10
24
.
0
+
0
.
5
;
bitRate
=
st
.
st_size
*
8
.
0
/
cb
->
totalTime
/
10
00
.
0
+
0
.
5
;
if
(
af
->
bits
!=
8
&&
af
->
bits
!=
16
)
{
ERROR
(
"Only 8 and 16-bit files are supported. %s is %i-bit
\n
"
,
...
...
src/flac_decode.c
View file @
73bcce33
...
...
@@ -219,7 +219,7 @@ FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__FileDecoder *dec, const FLA
FLAC__file_decoder_get_decode_position
(
dec
,
&
newPosition
);
if
(
data
->
position
)
{
data
->
bitRate
=
((
newPosition
-
data
->
position
)
*
8
.
0
/
timeChange
)
/
10
24
+
0
.
5
;
/
10
00
+
0
.
5
;
}
data
->
position
=
newPosition
;
...
...
src/mp3_decode.c
View file @
73bcce33
...
...
@@ -416,7 +416,7 @@ int mp3ChildSendData(mp3DecodeData * data, Buffer * cb, DecoderControl * dc) {
memcpy
(
cb
->
chunks
+
cb
->
end
*
CHUNK_SIZE
,
data
->
outputBuffer
,
CHUNK_SIZE
);
cb
->
chunkSize
[
cb
->
end
]
=
data
->
outputPtr
-
data
->
outputBuffer
;
cb
->
bitRate
[
cb
->
end
]
=
data
->
bitRate
/
10
24
;
cb
->
bitRate
[
cb
->
end
]
=
data
->
bitRate
/
10
00
;
cb
->
times
[
cb
->
end
]
=
data
->
elapsedTime
;
cb
->
end
++
;
...
...
src/mp4_decode.c
View file @
73bcce33
...
...
@@ -270,7 +270,7 @@ int mp4_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
initial
=
0
;
bitRate
=
frameInfo
.
bytesconsumed
*
8
.
0
*
frameInfo
.
channels
*
scale
/
frameInfo
.
samples
/
10
24
+
0
.
5
;
frameInfo
.
samples
/
10
00
+
0
.
5
;
}
...
...
src/ogg_decode.c
View file @
73bcce33
...
...
@@ -122,7 +122,7 @@ int ogg_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
chunkpos
=
0
;
cb
->
times
[
cb
->
end
]
=
ov_time_tell
(
&
vf
);
if
((
test
=
ov_bitrate_instant
(
&
vf
))
>
0
)
{
bitRate
=
test
/
10
24
;
bitRate
=
test
/
10
00
;
}
cb
->
bitRate
[
cb
->
end
]
=
bitRate
;
cb
->
end
++
;
...
...
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