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
bd5a6020
Commit
bd5a6020
authored
Aug 18, 2003
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use codec_tag for encoding too
Originally committed as revision 2125 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
f8188626
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
12 deletions
+23
-12
avcodec.h
libavcodec/avcodec.h
+1
-1
asf.c
libavformat/asf.c
+12
-2
au.c
libavformat/au.c
+4
-5
wav.c
libavformat/wav.c
+6
-4
No files found.
libavcodec/avcodec.h
View file @
bd5a6020
...
...
@@ -611,7 +611,7 @@ typedef struct AVCodecContext {
/**
* fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
* this is used to workaround some encoder bugs
* - encoding:
un
used
* - encoding:
set by user, if not then the default based on codec_id will be
used
* - decoding: set by user, will be converted to upper case by lavc during init
*/
unsigned
int
codec_tag
;
...
...
libavformat/asf.c
View file @
bd5a6020
...
...
@@ -411,13 +411,23 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
put_le16
(
pb
,
asf
->
streams
[
n
].
num
);
put_str16
(
pb
,
p
?
p
->
name
:
enc
->
codec_name
);
put_le16
(
pb
,
0
);
/* no parameters */
/* id */
if
(
enc
->
codec_type
==
CODEC_TYPE_AUDIO
)
{
put_le16
(
pb
,
2
);
put_le16
(
pb
,
codec_get_tag
(
codec_wav_tags
,
enc
->
codec_id
));
if
(
!
enc
->
codec_tag
)
enc
->
codec_tag
=
codec_get_tag
(
codec_wav_tags
,
enc
->
codec_id
);
if
(
!
enc
->
codec_tag
)
return
-
1
;
put_le16
(
pb
,
enc
->
codec_tag
);
}
else
{
put_le16
(
pb
,
4
);
put_le32
(
pb
,
codec_get_tag
(
codec_bmp_tags
,
enc
->
codec_id
));
if
(
!
enc
->
codec_tag
)
enc
->
codec_tag
=
codec_get_tag
(
codec_bmp_tags
,
enc
->
codec_id
);
if
(
!
enc
->
codec_tag
)
return
-
1
;
put_le32
(
pb
,
enc
->
codec_tag
);
}
}
end_header
(
pb
,
hpos
);
...
...
libavformat/au.c
View file @
bd5a6020
...
...
@@ -42,15 +42,14 @@ static const CodecTag codec_au_tags[] = {
/* AUDIO_FILE header */
static
int
put_au_header
(
ByteIOContext
*
pb
,
AVCodecContext
*
enc
)
{
int
tag
;
tag
=
codec_get_tag
(
codec_au_tags
,
enc
->
codec_id
);
if
(
tag
==
0
)
if
(
!
enc
->
codec_tag
)
enc
->
codec_tag
=
codec_get_tag
(
codec_au_tags
,
enc
->
codec_id
);
if
(
!
enc
->
codec_tag
)
return
-
1
;
put_tag
(
pb
,
".snd"
);
/* magic number */
put_be32
(
pb
,
24
);
/* header size */
put_be32
(
pb
,
AU_UNKOWN_SIZE
);
/* data size */
put_be32
(
pb
,
(
uint32_t
)
tag
);
/* codec ID */
put_be32
(
pb
,
(
uint32_t
)
enc
->
codec_
tag
);
/* codec ID */
put_be32
(
pb
,
enc
->
sample_rate
);
put_be32
(
pb
,
(
uint32_t
)
enc
->
channels
);
return
0
;
...
...
libavformat/wav.c
View file @
bd5a6020
...
...
@@ -38,13 +38,15 @@ const CodecTag codec_wav_tags[] = {
/* returns the size or -1 on error */
int
put_wav_header
(
ByteIOContext
*
pb
,
AVCodecContext
*
enc
)
{
int
tag
,
bps
,
blkalign
,
bytespersec
;
int
bps
,
blkalign
,
bytespersec
;
int
hdrsize
=
18
;
tag
=
codec_get_tag
(
codec_wav_tags
,
enc
->
codec_id
);
if
(
tag
==
0
)
if
(
!
enc
->
codec_tag
)
enc
->
codec_tag
=
codec_get_tag
(
codec_wav_tags
,
enc
->
codec_id
);
if
(
!
enc
->
codec_tag
)
return
-
1
;
put_le16
(
pb
,
tag
);
put_le16
(
pb
,
enc
->
codec_tag
);
put_le16
(
pb
,
enc
->
channels
);
put_le32
(
pb
,
enc
->
sample_rate
);
if
(
enc
->
codec_id
==
CODEC_ID_PCM_U8
||
...
...
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