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
e1b032cb
Commit
e1b032cb
authored
Nov 27, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: work around bogus channel count
Initialize the audio_format before calling avcodec_open(), because avcodec_open() will fill bogus values.
parent
6f365c30
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
NEWS
NEWS
+1
-0
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+12
-8
No files found.
NEWS
View file @
e1b032cb
ver 0.16.6 (2010/??/??)
* decoder:
- fix assertion failure when resuming streams
- ffmpeg: work around bogus channel count
* encoder:
- flac, null, wave: fix buffer corruption bug
- wave: support packed 24 bit samples
...
...
src/decoder/ffmpeg_decoder_plugin.c
View file @
e1b032cb
...
...
@@ -407,13 +407,6 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
return
;
}
if
(
avcodec_open
(
codec_context
,
codec
)
<
0
)
{
g_warning
(
"Could not open codec
\n
"
);
av_close_input_stream
(
format_context
);
mpd_ffmpeg_stream_close
(
stream
);
return
;
}
GError
*
error
=
NULL
;
struct
audio_format
audio_format
;
if
(
!
audio_format_init_checked
(
&
audio_format
,
...
...
@@ -422,7 +415,18 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input)
codec_context
->
channels
,
&
error
))
{
g_warning
(
"%s"
,
error
->
message
);
g_error_free
(
error
);
avcodec_close
(
codec_context
);
av_close_input_stream
(
format_context
);
mpd_ffmpeg_stream_close
(
stream
);
return
;
}
/* the audio format must be read from AVCodecContext by now,
because avcodec_open() has been demonstrated to fill bogus
values into AVCodecContext.channels - a change that will be
reverted later by avcodec_decode_audio3() */
if
(
avcodec_open
(
codec_context
,
codec
)
<
0
)
{
g_warning
(
"Could not open codec
\n
"
);
av_close_input_stream
(
format_context
);
mpd_ffmpeg_stream_close
(
stream
);
return
;
...
...
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