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
4728735a
Commit
4728735a
authored
Oct 28, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/dsf: don't play junk at the end of the "data" chunk
parent
9dcbd005
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
NEWS
NEWS
+1
-0
DsfDecoderPlugin.cxx
src/decoder/DsfDecoderPlugin.cxx
+9
-1
No files found.
NEWS
View file @
4728735a
...
...
@@ -15,6 +15,7 @@ ver 0.18 (2012/??/??)
- lastfm: remove defunct Last.fm support
* decoder:
- adplug: new decoder plugin using libadplug
- dsf: don't play junk at the end of the "data" chunk
- ffmpeg: drop support for pre-0.8 ffmpeg
- flac: require libFLAC 1.2 or newer
- flac: support FLAC files inside archives
...
...
src/decoder/DsfDecoderPlugin.cxx
View file @
4728735a
...
...
@@ -156,12 +156,20 @@ dsf_read_metadata(Decoder *decoder, InputStream &is,
data_size
-=
sizeof
(
data_chunk
);
metadata
->
chunk_size
=
data_size
;
/* data_size cannot be bigger or equal to total file size */
const
uint64_t
size
=
(
uint64_t
)
is
.
GetSize
();
if
(
data_size
>=
size
)
return
false
;
/* use the sample count from the DSF header as the upper
bound, because some DSF files contain junk at the end of
the "data" chunk */
const
uint64_t
samplecnt
=
dsf_fmt_chunk
.
scnt
.
Read
();
const
uint64_t
playable_size
=
samplecnt
*
2
/
8
;
if
(
data_size
>
playable_size
)
data_size
=
playable_size
;
metadata
->
chunk_size
=
data_size
;
metadata
->
channels
=
(
unsigned
)
dsf_fmt_chunk
.
channelnum
;
metadata
->
sample_rate
=
samplefreq
;
#ifdef HAVE_ID3TAG
...
...
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