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
6c56827e
Commit
6c56827e
authored
Jun 20, 2015
by
Rodger Combs
Committed by
Paul B Mahol
Jun 21, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/brstm: move bfstm var to a local
parent
6c8a0526
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
14 deletions
+9
-14
brstm.c
libavformat/brstm.c
+9
-14
No files found.
libavformat/brstm.c
View file @
6c56827e
...
...
@@ -32,7 +32,6 @@ typedef struct BRSTMDemuxContext {
uint32_t
last_block_used_bytes
;
uint8_t
*
table
;
uint8_t
*
adpc
;
int
bfstm
;
int
little_endian
;
}
BRSTMDemuxContext
;
...
...
@@ -91,8 +90,7 @@ static int read_header(AVFormatContext *s)
uint32_t
size
,
start
,
asize
;
AVStream
*
st
;
int
ret
=
AVERROR_EOF
;
b
->
bfstm
=
!
strcmp
(
"bfstm"
,
s
->
iformat
->
name
);
int
bfstm
=
!
strcmp
(
"bfstm"
,
s
->
iformat
->
name
);
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
...
...
@@ -110,7 +108,7 @@ static int read_header(AVFormatContext *s)
if
(
bom
==
0xFFFE
)
b
->
little_endian
=
1
;
if
(
!
b
->
b
fstm
)
{
if
(
!
bfstm
)
{
major
=
avio_r8
(
s
->
pb
);
minor
=
avio_r8
(
s
->
pb
);
avio_skip
(
s
->
pb
,
4
);
// size of file
...
...
@@ -202,18 +200,18 @@ static int read_header(AVFormatContext *s)
avio_skip
(
s
->
pb
,
1
);
// padding
st
->
codec
->
sample_rate
=
b
->
b
fstm
?
read32
(
s
)
:
read16
(
s
);
st
->
codec
->
sample_rate
=
bfstm
?
read32
(
s
)
:
read16
(
s
);
if
(
!
st
->
codec
->
sample_rate
)
return
AVERROR_INVALIDDATA
;
if
(
!
b
->
b
fstm
)
if
(
!
bfstm
)
avio_skip
(
s
->
pb
,
2
);
// padding
avio_skip
(
s
->
pb
,
4
);
// loop start sample
st
->
start_time
=
0
;
st
->
duration
=
read32
(
s
);
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
if
(
!
b
->
b
fstm
)
if
(
!
bfstm
)
start
=
read32
(
s
);
b
->
current_block
=
0
;
b
->
block_count
=
read32
(
s
);
...
...
@@ -240,7 +238,7 @@ static int read_header(AVFormatContext *s)
int
ch
;
avio_skip
(
s
->
pb
,
pos
+
toffset
-
avio_tell
(
s
->
pb
));
if
(
!
b
->
b
fstm
)
if
(
!
bfstm
)
toffset
=
read32
(
s
)
+
16LL
;
else
toffset
=
toffset
+
read32
(
s
)
+
st
->
codec
->
channels
*
8
-
8
;
...
...
@@ -274,10 +272,7 @@ static int read_header(AVFormatContext *s)
goto
fail
;
}
if
(
!
b
->
bfstm
)
avio_skip
(
s
->
pb
,
size
-
(
avio_tell
(
s
->
pb
)
-
pos
));
else
avio_skip
(
s
->
pb
,
data_offset
-
avio_tell
(
s
->
pb
));
avio_skip
(
s
->
pb
,
size
-
(
avio_tell
(
s
->
pb
)
-
pos
));
while
(
!
avio_feof
(
s
->
pb
))
{
chunk
=
avio_rl32
(
s
->
pb
);
...
...
@@ -315,13 +310,13 @@ static int read_header(AVFormatContext *s)
if
((
start
<
avio_tell
(
s
->
pb
))
||
(
!
b
->
adpc
&&
(
codec
==
AV_CODEC_ID_ADPCM_THP
||
codec
==
AV_CODEC_ID_ADPCM_THP_LE
)
&&
!
b
->
b
fstm
))
{
&&
!
bfstm
))
{
ret
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
avio_skip
(
s
->
pb
,
start
-
avio_tell
(
s
->
pb
));
if
((
major
!=
1
||
minor
)
&&
!
b
->
b
fstm
)
if
((
major
!=
1
||
minor
)
&&
!
bfstm
)
avpriv_request_sample
(
s
,
"Version %d.%d"
,
major
,
minor
);
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