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
923bd441
Commit
923bd441
authored
Feb 21, 2005
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct pcm in flv handling
Originally committed as revision 3968 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
58aa2b1d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
flvdec.c
libavformat/flvdec.c
+6
-1
flvenc.c
libavformat/flvenc.c
+12
-4
No files found.
libavformat/flvdec.c
View file @
923bd441
...
...
@@ -60,7 +60,7 @@ static int flv_read_header(AVFormatContext *s,
static
int
flv_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
int
ret
,
i
,
type
,
size
,
pts
,
flags
,
is_audio
;
AVStream
*
st
;
AVStream
*
st
=
NULL
;
for
(;;){
url_fskip
(
&
s
->
pb
,
4
);
/* size of previous packet */
...
...
@@ -122,7 +122,12 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
else
st
->
codec
.
sample_rate
=
(
44100
<<
((
flags
>>
2
)
&
3
))
>>
3
;
switch
(
flags
>>
4
){
/* 0: uncompressed 1: ADPCM 2: mp3 5: Nellymoser 8kHz mono 6: Nellymoser*/
case
0
:
if
(
flags
&
2
)
st
->
codec
.
codec_id
=
CODEC_ID_PCM_S16BE
;
else
st
->
codec
.
codec_id
=
CODEC_ID_PCM_S8
;
break
;
case
2
:
st
->
codec
.
codec_id
=
CODEC_ID_MP3
;
break
;
// this is not listed at FLV but at SWF, strange...
case
3
:
if
(
flags
&
2
)
st
->
codec
.
codec_id
=
CODEC_ID_PCM_S16LE
;
else
st
->
codec
.
codec_id
=
CODEC_ID_PCM_S8
;
break
;
default:
st
->
codec
.
codec_tag
=
(
flags
>>
4
);
}
...
...
libavformat/flvenc.c
View file @
923bd441
...
...
@@ -35,7 +35,7 @@ static void put_be24(ByteIOContext *pb, int value)
}
static
int
get_audio_flags
(
AVCodecContext
*
enc
){
int
flags
=
0
x02
;
int
flags
=
0
;
switch
(
enc
->
sample_rate
)
{
case
44100
:
...
...
@@ -61,7 +61,15 @@ static int get_audio_flags(AVCodecContext *enc){
switch
(
enc
->
codec_id
){
case
CODEC_ID_MP3
:
flags
|=
0x20
;
flags
|=
0x20
|
0x2
;
break
;
case
CODEC_ID_PCM_S8
:
break
;
case
CODEC_ID_PCM_S16BE
:
flags
|=
0x60
|
0x2
;
break
;
case
CODEC_ID_PCM_S16LE
:
flags
|=
0x2
;
break
;
case
0
:
flags
|=
enc
->
codec_tag
<<
4
;
...
...
@@ -155,7 +163,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
put_be32
(
pb
,
flv
->
reserved
);
put_byte
(
pb
,
flags
);
put_buffer
(
pb
,
pkt
->
data
,
size
);
put_be32
(
pb
,
size
+
1
+
11
);
//
reserved
put_be32
(
pb
,
size
+
1
+
11
);
//
previous tag size
put_flush_packet
(
pb
);
return
0
;
...
...
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