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
9c9cf395
Commit
9c9cf395
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: add support for seeking
parent
70a39bcf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
brstm.c
libavformat/brstm.c
+23
-0
No files found.
libavformat/brstm.c
View file @
9c9cf395
...
...
@@ -32,6 +32,7 @@ typedef struct BRSTMDemuxContext {
uint32_t
last_block_used_bytes
;
uint32_t
last_block_size
;
uint32_t
last_block_samples
;
uint32_t
data_start
;
uint8_t
*
table
;
uint8_t
*
adpc
;
int
little_endian
;
...
...
@@ -312,6 +313,8 @@ static int read_header(AVFormatContext *s)
codec
==
AV_CODEC_ID_ADPCM_THP_LE
))
avio_skip
(
s
->
pb
,
24
);
b
->
data_start
=
avio_tell
(
s
->
pb
);
if
((
major
!=
1
||
minor
)
&&
!
bfstm
)
avpriv_request_sample
(
s
,
"Version %d.%d"
,
major
,
minor
);
...
...
@@ -391,6 +394,24 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
return
ret
;
}
static
int
read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
timestamp
,
int
flags
)
{
AVStream
*
st
=
s
->
streams
[
stream_index
];
BRSTMDemuxContext
*
b
=
s
->
priv_data
;
int64_t
ret
=
0
;
timestamp
/=
b
->
samples_per_block
;
ret
=
avio_seek
(
s
->
pb
,
b
->
data_start
+
timestamp
*
b
->
block_size
*
st
->
codec
->
channels
,
SEEK_SET
);
if
(
ret
<
0
)
return
ret
;
b
->
current_block
=
timestamp
;
ff_update_cur_dts
(
s
,
st
,
timestamp
*
b
->
samples_per_block
);
return
0
;
}
AVInputFormat
ff_brstm_demuxer
=
{
.
name
=
"brstm"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"BRSTM (Binary Revolution Stream)"
),
...
...
@@ -399,6 +420,7 @@ AVInputFormat ff_brstm_demuxer = {
.
read_header
=
read_header
,
.
read_packet
=
read_packet
,
.
read_close
=
read_close
,
.
read_seek
=
read_seek
,
.
extensions
=
"brstm"
,
};
...
...
@@ -410,5 +432,6 @@ AVInputFormat ff_bfstm_demuxer = {
.
read_header
=
read_header
,
.
read_packet
=
read_packet
,
.
read_close
=
read_close
,
.
read_seek
=
read_seek
,
.
extensions
=
"bfstm,bcstm"
,
};
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