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
0643b4bf
Commit
0643b4bf
authored
Jun 23, 2015
by
Rodger Combs
Committed by
Michael Niedermayer
Jun 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/brstm: expose the loop point when present
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2c77ca45
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
brstm.c
libavformat/brstm.c
+13
-2
No files found.
libavformat/brstm.c
View file @
0643b4bf
...
@@ -93,6 +93,7 @@ static int read_header(AVFormatContext *s)
...
@@ -93,6 +93,7 @@ static int read_header(AVFormatContext *s)
uint32_t
size
,
asize
,
start
=
0
;
uint32_t
size
,
asize
,
start
=
0
;
AVStream
*
st
;
AVStream
*
st
;
int
ret
=
AVERROR_EOF
;
int
ret
=
AVERROR_EOF
;
int
loop
=
0
;
int
bfstm
=
!
strcmp
(
"bfstm"
,
s
->
iformat
->
name
);
int
bfstm
=
!
strcmp
(
"bfstm"
,
s
->
iformat
->
name
);
st
=
avformat_new_stream
(
s
,
NULL
);
st
=
avformat_new_stream
(
s
,
NULL
);
...
@@ -195,7 +196,7 @@ static int read_header(AVFormatContext *s)
...
@@ -195,7 +196,7 @@ static int read_header(AVFormatContext *s)
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
avio_skip
(
s
->
pb
,
1
);
// loop flag
loop
=
avio_r8
(
s
->
pb
);
// loop flag
st
->
codec
->
codec_id
=
codec
;
st
->
codec
->
codec_id
=
codec
;
st
->
codec
->
channels
=
avio_r8
(
s
->
pb
);
st
->
codec
->
channels
=
avio_r8
(
s
->
pb
);
if
(
!
st
->
codec
->
channels
)
if
(
!
st
->
codec
->
channels
)
...
@@ -209,7 +210,17 @@ static int read_header(AVFormatContext *s)
...
@@ -209,7 +210,17 @@ static int read_header(AVFormatContext *s)
if
(
!
bfstm
)
if
(
!
bfstm
)
avio_skip
(
s
->
pb
,
2
);
// padding
avio_skip
(
s
->
pb
,
2
);
// padding
avio_skip
(
s
->
pb
,
4
);
// loop start sample
if
(
loop
)
{
if
(
av_dict_set_int
(
&
s
->
metadata
,
"loop_start"
,
av_rescale
(
read32
(
s
),
AV_TIME_BASE
,
st
->
codec
->
sample_rate
),
0
)
<
0
)
return
AVERROR
(
ENOMEM
);
}
else
{
avio_skip
(
s
->
pb
,
4
);
}
st
->
start_time
=
0
;
st
->
start_time
=
0
;
st
->
duration
=
read32
(
s
);
st
->
duration
=
read32
(
s
);
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
avpriv_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
...
...
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