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
3f89f774
Commit
3f89f774
authored
Nov 04, 2010
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/ffmpeg: check AVCodecContext.sample_fmt value
.. instead of av_get_bits_per_sample_format(). The SampleFormat enum value is authoritative.
parent
9dee419b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
ffmpeg_decoder_plugin.c
src/decoder/ffmpeg_decoder_plugin.c
+9
-7
No files found.
src/decoder/ffmpeg_decoder_plugin.c
View file @
3f89f774
...
@@ -231,16 +231,18 @@ static enum sample_format
...
@@ -231,16 +231,18 @@ static enum sample_format
ffmpeg_sample_format
(
G_GNUC_UNUSED
const
AVCodecContext
*
codec_context
)
ffmpeg_sample_format
(
G_GNUC_UNUSED
const
AVCodecContext
*
codec_context
)
{
{
#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0)
#if LIBAVCODEC_VERSION_INT >= ((51<<16)+(41<<8)+0)
int
bits
=
(
uint8_t
)
av_get_bits_per_sample_format
(
codec_context
->
sample_fmt
);
switch
(
codec_context
->
sample_fmt
)
{
case
SAMPLE_FMT_S16
:
return
SAMPLE_FORMAT_S16
;
/* XXX implement & test other sample formats */
case
SAMPLE_FMT_S32
:
return
SAMPLE_FORMAT_S32
;
switch
(
bits
)
{
default:
case
16
:
g_warning
(
"Unsupported libavcodec SampleFormat value: %d"
,
return
SAMPLE_FORMAT_S16
;
codec_context
->
sample_fmt
);
return
SAMPLE_FORMAT_UNDEFINED
;
}
}
return
SAMPLE_FORMAT_UNDEFINED
;
#else
#else
/* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */
/* XXX fixme 16-bit for older ffmpeg (13 Aug 2007) */
return
SAMPLE_FORMAT_S16
;
return
SAMPLE_FORMAT_S16
;
...
...
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