Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
44008871
Commit
44008871
authored
Sep 05, 2007
by
David Conrad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write bit depth for PCM audio
Originally committed as revision 10322 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
1a302a5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
matroskaenc.c
libavformat/matroskaenc.c
+17
-1
No files found.
libavformat/matroskaenc.c
View file @
44008871
...
...
@@ -366,6 +366,7 @@ static int mkv_write_tracks(AVFormatContext *s)
AVCodecContext
*
codec
=
st
->
codec
;
offset_t
subinfo
,
track
;
int
native_id
=
0
;
int
bit_depth
=
0
;
track
=
start_ebml_master
(
pb
,
MATROSKA_ID_TRACKENTRY
);
put_ebml_uint
(
pb
,
MATROSKA_ID_TRACKNUMBER
,
i
+
1
);
...
...
@@ -384,6 +385,19 @@ static int mkv_write_tracks(AVFormatContext *s)
}
}
switch
(
codec
->
codec_id
)
{
case
CODEC_ID_PCM_S16LE
:
case
CODEC_ID_PCM_S16BE
:
case
CODEC_ID_PCM_U16LE
:
case
CODEC_ID_PCM_U16BE
:
bit_depth
=
16
;
break
;
case
CODEC_ID_PCM_S8
:
case
CODEC_ID_PCM_U8
:
bit_depth
=
8
;
break
;
}
// XXX: CodecPrivate for vorbis, theora, aac, native mpeg4, ...
if
(
native_id
)
{
if
(
codec
->
codec_id
==
CODEC_ID_VORBIS
||
codec
->
codec_id
==
CODEC_ID_THEORA
)
{
...
...
@@ -438,7 +452,9 @@ static int mkv_write_tracks(AVFormatContext *s)
subinfo
=
start_ebml_master
(
pb
,
MATROSKA_ID_TRACKAUDIO
);
put_ebml_uint
(
pb
,
MATROSKA_ID_AUDIOCHANNELS
,
codec
->
channels
);
put_ebml_float
(
pb
,
MATROSKA_ID_AUDIOSAMPLINGFREQ
,
codec
->
sample_rate
);
// XXX: output sample freq (for sbr) and bitdepth (for pcm)
// XXX: output sample freq (for sbr)
if
(
bit_depth
)
put_ebml_uint
(
pb
,
MATROSKA_ID_AUDIOBITDEPTH
,
bit_depth
);
end_ebml_master
(
pb
,
subinfo
);
break
;
...
...
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