Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
efb9892a
Commit
efb9892a
authored
May 02, 2010
by
Laurent Aimar
Committed by
Jean-Baptiste Kempf
May 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved out avcodec SampleFormat -> VLC formats to its own function.
(cherry picked manually from commit
cc4676bf
)
parent
b6082c50
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
16 deletions
+23
-16
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+22
-16
modules/codec/avcodec/avcodec.h
modules/codec/avcodec/avcodec.h
+1
-0
No files found.
modules/codec/avcodec/audio.c
View file @
efb9892a
...
...
@@ -469,41 +469,47 @@ static const uint64_t pi_channels_map[][2] =
};
#endif
static
void
SetupOutputFormat
(
decoder_t
*
p_dec
,
bool
b_trus
t
)
void
GetVlcAudioFormat
(
vlc_fourcc_t
*
pi_codec
,
unsigned
*
pi_bits
,
int
i_sample_fm
t
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 65, 0 )
switch
(
p_sys
->
p_context
->
sample_fmt
)
switch
(
i_sample_fmt
)
{
case
SAMPLE_FMT_U8
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_U8
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
8
;
*
p
i_codec
=
VLC_CODEC_U8
;
*
pi_bits
=
8
;
break
;
case
SAMPLE_FMT_S32
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S32N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
32
;
*
p
i_codec
=
VLC_CODEC_S32N
;
*
pi_bits
=
32
;
break
;
case
SAMPLE_FMT_FLT
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_FL32
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
32
;
*
p
i_codec
=
VLC_CODEC_FL32
;
*
pi_bits
=
32
;
break
;
case
SAMPLE_FMT_DBL
:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_FL64
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
64
;
*
p
i_codec
=
VLC_CODEC_FL64
;
*
pi_bits
=
64
;
break
;
case
SAMPLE_FMT_S16
:
default:
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
16
;
*
p
i_codec
=
VLC_CODEC_S16N
;
*
pi_bits
=
16
;
break
;
}
}
static
void
SetupOutputFormat
(
decoder_t
*
p_dec
,
bool
b_trust
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( 51, 65, 0 )
GetVlcAudioFormat
(
&
p_dec
->
fmt_out
.
i_codec
,
&
p_dec
->
fmt_out
.
audio
.
i_bitspersample
,
p_sys
->
p_context
->
sample_fmt
);
#else
p_dec
->
fmt_out
.
i_codec
=
VLC_CODEC_S16N
;
p_dec
->
fmt_out
.
audio
.
i_bitspersample
=
16
;
#endif
p_dec
->
fmt_out
.
audio
.
i_rate
=
p_sys
->
p_context
->
sample_rate
;
p_dec
->
fmt_out
.
audio
.
i_rate
=
p_sys
->
p_context
->
sample_rate
;
/* */
#if defined(LIBAVCODEC_AUDIO_LAYOUT)
...
...
modules/codec/avcodec/avcodec.h
View file @
efb9892a
...
...
@@ -29,6 +29,7 @@ int GetVlcFourcc( int i_ffmpeg_codec, int *pi_cat,
int
TestFfmpegChroma
(
const
int
i_ffmpeg_id
,
const
vlc_fourcc_t
i_vlc_fourcc
);
int
GetFfmpegChroma
(
int
*
i_ffmpeg_chroma
,
const
video_format_t
fmt
);
int
GetVlcChroma
(
video_format_t
*
fmt
,
const
int
i_ffmpeg_chroma
);
void
GetVlcAudioFormat
(
vlc_fourcc_t
*
,
unsigned
*
pi_bits
,
int
i_sample_fmt
);
picture_t
*
DecodeVideo
(
decoder_t
*
,
block_t
**
);
...
...
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