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
88084eec
Commit
88084eec
authored
Jul 24, 2011
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use little endian for caf codec tags.
parent
9e4ed295
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
30 deletions
+30
-30
caf.c
libavformat/caf.c
+26
-26
cafdec.c
libavformat/cafdec.c
+2
-2
cafenc.c
libavformat/cafenc.c
+2
-2
No files found.
libavformat/caf.c
View file @
88084eec
...
@@ -32,34 +32,34 @@
...
@@ -32,34 +32,34 @@
* Known codec tags for CAF
* Known codec tags for CAF
*/
*/
const
AVCodecTag
ff_codec_caf_tags
[]
=
{
const
AVCodecTag
ff_codec_caf_tags
[]
=
{
{
CODEC_ID_AAC
,
MK
BE
TAG
(
'a'
,
'a'
,
'c'
,
' '
)
},
{
CODEC_ID_AAC
,
MKTAG
(
'a'
,
'a'
,
'c'
,
' '
)
},
{
CODEC_ID_AC3
,
MK
BE
TAG
(
'a'
,
'c'
,
'-'
,
'3'
)
},
{
CODEC_ID_AC3
,
MKTAG
(
'a'
,
'c'
,
'-'
,
'3'
)
},
{
CODEC_ID_ALAC
,
MK
BE
TAG
(
'a'
,
'l'
,
'a'
,
'c'
)
},
{
CODEC_ID_ALAC
,
MKTAG
(
'a'
,
'l'
,
'a'
,
'c'
)
},
/* FIXME: use DV demuxer, as done in MOV */
/* FIXME: use DV demuxer, as done in MOV */
/*{ CODEC_ID_DVAUDIO, MK
BE
TAG('v','d','v','a') },*/
/*{ CODEC_ID_DVAUDIO, MKTAG('v','d','v','a') },*/
/*{ CODEC_ID_DVAUDIO, MK
BE
TAG('d','v','c','a') },*/
/*{ CODEC_ID_DVAUDIO, MKTAG('d','v','c','a') },*/
{
CODEC_ID_ADPCM_IMA_QT
,
MK
BE
TAG
(
'i'
,
'm'
,
'a'
,
'4'
)
},
{
CODEC_ID_ADPCM_IMA_QT
,
MKTAG
(
'i'
,
'm'
,
'a'
,
'4'
)
},
{
CODEC_ID_ADPCM_IMA_WAV
,
MK
BE
TAG
(
'm'
,
's'
,
0
,
17
)
},
{
CODEC_ID_ADPCM_IMA_WAV
,
MKTAG
(
'm'
,
's'
,
0
,
17
)
},
{
CODEC_ID_ADPCM_MS
,
MK
BE
TAG
(
'm'
,
's'
,
0
,
2
)
},
{
CODEC_ID_ADPCM_MS
,
MKTAG
(
'm'
,
's'
,
0
,
2
)
},
{
CODEC_ID_AMR_NB
,
MK
BE
TAG
(
's'
,
'a'
,
'm'
,
'r'
)
},
{
CODEC_ID_AMR_NB
,
MKTAG
(
's'
,
'a'
,
'm'
,
'r'
)
},
{
CODEC_ID_GSM
,
MK
BE
TAG
(
'a'
,
'g'
,
's'
,
'm'
)
},
{
CODEC_ID_GSM
,
MKTAG
(
'a'
,
'g'
,
's'
,
'm'
)
},
{
CODEC_ID_GSM_MS
,
MK
BE
TAG
(
'm'
,
's'
,
0
,
'1'
)
},
{
CODEC_ID_GSM_MS
,
MKTAG
(
'm'
,
's'
,
0
,
'1'
)
},
{
CODEC_ID_MACE3
,
MK
BE
TAG
(
'M'
,
'A'
,
'C'
,
'3'
)
},
{
CODEC_ID_MACE3
,
MKTAG
(
'M'
,
'A'
,
'C'
,
'3'
)
},
{
CODEC_ID_MACE6
,
MK
BE
TAG
(
'M'
,
'A'
,
'C'
,
'6'
)
},
{
CODEC_ID_MACE6
,
MKTAG
(
'M'
,
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MK
BE
TAG('c','a','c','3') },*/
/*{ AC-3 over S/PDIF MKTAG('c','a','c','3') },*/
/*{ MPEG4CELP MK
BE
TAG('c','e','l','p') },*/
/*{ MPEG4CELP MKTAG('c','e','l','p') },*/
/*{ MPEG4HVXC MK
BE
TAG('h','v','x','c') },*/
/*{ MPEG4HVXC MKTAG('h','v','x','c') },*/
/*{ MPEG4TwinVQ MK
BE
TAG('t','w','v','q') },*/
/*{ MPEG4TwinVQ MKTAG('t','w','v','q') },*/
{
CODEC_ID_NONE
,
0
},
{
CODEC_ID_NONE
,
0
},
};
};
libavformat/cafdec.c
View file @
88084eec
...
@@ -68,7 +68,7 @@ static int read_desc_chunk(AVFormatContext *s)
...
@@ -68,7 +68,7 @@ static int read_desc_chunk(AVFormatContext *s)
/* parse format description */
/* parse format description */
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_AUDIO
;
st
->
codec
->
sample_rate
=
av_int2dbl
(
avio_rb64
(
pb
));
st
->
codec
->
sample_rate
=
av_int2dbl
(
avio_rb64
(
pb
));
st
->
codec
->
codec_tag
=
avio_r
b
32
(
pb
);
st
->
codec
->
codec_tag
=
avio_r
l
32
(
pb
);
flags
=
avio_rb32
(
pb
);
flags
=
avio_rb32
(
pb
);
caf
->
bytes_per_packet
=
avio_rb32
(
pb
);
caf
->
bytes_per_packet
=
avio_rb32
(
pb
);
st
->
codec
->
block_align
=
caf
->
bytes_per_packet
;
st
->
codec
->
block_align
=
caf
->
bytes_per_packet
;
...
@@ -85,7 +85,7 @@ static int read_desc_chunk(AVFormatContext *s)
...
@@ -85,7 +85,7 @@ static int read_desc_chunk(AVFormatContext *s)
}
}
/* determine codec */
/* determine codec */
if
(
st
->
codec
->
codec_tag
==
MK
BE
TAG
(
'l'
,
'p'
,
'c'
,
'm'
))
if
(
st
->
codec
->
codec_tag
==
MKTAG
(
'l'
,
'p'
,
'c'
,
'm'
))
st
->
codec
->
codec_id
=
ff_mov_get_lpcm_codec_id
(
st
->
codec
->
bits_per_coded_sample
,
(
flags
^
0x2
)
|
0x4
);
st
->
codec
->
codec_id
=
ff_mov_get_lpcm_codec_id
(
st
->
codec
->
bits_per_coded_sample
,
(
flags
^
0x2
)
|
0x4
);
else
else
st
->
codec
->
codec_id
=
ff_codec_get_id
(
ff_codec_caf_tags
,
st
->
codec
->
codec_tag
);
st
->
codec
->
codec_id
=
ff_codec_get_id
(
ff_codec_caf_tags
,
st
->
codec
->
codec_tag
);
...
...
libavformat/cafenc.c
View file @
88084eec
...
@@ -114,7 +114,7 @@ static int caf_write_header(AVFormatContext *s)
...
@@ -114,7 +114,7 @@ static int caf_write_header(AVFormatContext *s)
case
CODEC_ID_PCM_F64BE
:
case
CODEC_ID_PCM_F64BE
:
case
CODEC_ID_PCM_ALAW
:
case
CODEC_ID_PCM_ALAW
:
case
CODEC_ID_PCM_MULAW
:
case
CODEC_ID_PCM_MULAW
:
codec_tag
=
MK
BE
TAG
(
'l'
,
'p'
,
'c'
,
'm'
);
codec_tag
=
MKTAG
(
'l'
,
'p'
,
'c'
,
'm'
);
}
}
if
(
!
codec_tag
)
{
if
(
!
codec_tag
)
{
...
@@ -134,7 +134,7 @@ static int caf_write_header(AVFormatContext *s)
...
@@ -134,7 +134,7 @@ static int caf_write_header(AVFormatContext *s)
ffio_wfourcc
(
pb
,
"desc"
);
//< Audio Description chunk
ffio_wfourcc
(
pb
,
"desc"
);
//< Audio Description chunk
avio_wb64
(
pb
,
32
);
//< mChunkSize
avio_wb64
(
pb
,
32
);
//< mChunkSize
avio_wb64
(
pb
,
av_dbl2int
(
enc
->
sample_rate
));
//< mSampleRate
avio_wb64
(
pb
,
av_dbl2int
(
enc
->
sample_rate
));
//< mSampleRate
avio_w
b
32
(
pb
,
codec_tag
);
//< mFormatID
avio_w
l
32
(
pb
,
codec_tag
);
//< mFormatID
avio_wb32
(
pb
,
codec_flags
(
enc
->
codec_id
));
//< mFormatFlags
avio_wb32
(
pb
,
codec_flags
(
enc
->
codec_id
));
//< mFormatFlags
avio_wb32
(
pb
,
enc
->
block_align
);
//< mBytesPerPacket
avio_wb32
(
pb
,
enc
->
block_align
);
//< mBytesPerPacket
avio_wb32
(
pb
,
samples_per_packet
(
enc
->
codec_id
,
enc
->
channels
));
//< mFramesPerPacket
avio_wb32
(
pb
,
samples_per_packet
(
enc
->
codec_id
,
enc
->
channels
));
//< mFramesPerPacket
...
...
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