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
200cdb6b
Commit
200cdb6b
authored
Oct 23, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/PcmConvert: assign {src,dest}_format at the end
Fixes assertion failure in destructor by not assigning {src,dest}_format when an error occurs.
parent
d9fb4020
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
NEWS
NEWS
+1
-0
PcmConvert.cxx
src/pcm/PcmConvert.cxx
+13
-12
No files found.
NEWS
View file @
200cdb6b
ver 0.19.2 (not yet released)
* fix assertion failure on unsupported PCM conversion
ver 0.19.1 (2014/10/19)
* input
...
...
src/pcm/PcmConvert.cxx
View file @
200cdb6b
...
...
@@ -59,36 +59,34 @@ PcmConvert::Open(const AudioFormat _src_format, const AudioFormat _dest_format,
assert
(
_src_format
.
IsValid
());
assert
(
_dest_format
.
IsValid
());
src_format
=
_src_format
;
dest_format
=
_dest_format
;
AudioFormat
format
=
src_format
;
AudioFormat
format
=
_src_format
;
if
(
format
.
format
==
SampleFormat
::
DSD
)
format
.
format
=
SampleFormat
::
FLOAT
;
enable_resampler
=
format
.
sample_rate
!=
dest_format
.
sample_rate
;
enable_resampler
=
format
.
sample_rate
!=
_
dest_format
.
sample_rate
;
if
(
enable_resampler
)
{
if
(
!
resampler
.
Open
(
format
,
dest_format
.
sample_rate
,
error
))
if
(
!
resampler
.
Open
(
format
,
_
dest_format
.
sample_rate
,
error
))
return
false
;
format
.
format
=
resampler
.
GetOutputSampleFormat
();
format
.
sample_rate
=
dest_format
.
sample_rate
;
format
.
sample_rate
=
_
dest_format
.
sample_rate
;
}
enable_format
=
format
.
format
!=
dest_format
.
format
;
enable_format
=
format
.
format
!=
_
dest_format
.
format
;
if
(
enable_format
&&
!
format_converter
.
Open
(
format
.
format
,
dest_format
.
format
,
error
))
{
!
format_converter
.
Open
(
format
.
format
,
_dest_format
.
format
,
error
))
{
if
(
enable_resampler
)
resampler
.
Close
();
return
false
;
}
format
.
format
=
dest_format
.
format
;
format
.
format
=
_
dest_format
.
format
;
enable_channels
=
format
.
channels
!=
dest_format
.
channels
;
enable_channels
=
format
.
channels
!=
_
dest_format
.
channels
;
if
(
enable_channels
&&
!
channels_converter
.
Open
(
format
.
format
,
format
.
channels
,
dest_format
.
channels
,
error
))
{
_
dest_format
.
channels
,
error
))
{
if
(
enable_format
)
format_converter
.
Close
();
if
(
enable_resampler
)
...
...
@@ -96,6 +94,9 @@ PcmConvert::Open(const AudioFormat _src_format, const AudioFormat _dest_format,
return
false
;
}
src_format
=
_src_format
;
dest_format
=
_dest_format
;
return
true
;
}
...
...
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