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
f55da220
Commit
f55da220
authored
Jan 11, 2017
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/dss: Support version 3 files / files with larger header.
Fixes ticket #6072.
parent
14b90601
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
dss.c
libavformat/dss.c
+9
-5
No files found.
libavformat/dss.c
View file @
f55da220
...
...
@@ -42,7 +42,6 @@
#define DSS_COMMENT_SIZE 64
#define DSS_BLOCK_SIZE 512
#define DSS_HEADER_SIZE (DSS_BLOCK_SIZE * 2)
#define DSS_AUDIO_BLOCK_HEADER_SIZE 6
#define DSS_FRAME_SIZE 42
...
...
@@ -56,11 +55,13 @@ typedef struct DSSDemuxContext {
int8_t
*
dss_sp_buf
;
int
packet_size
;
int
dss_header_size
;
}
DSSDemuxContext
;
static
int
dss_probe
(
AVProbeData
*
p
)
{
if
(
AV_RL32
(
p
->
buf
)
!=
MKTAG
(
0x2
,
'd'
,
's'
,
's'
))
if
(
AV_RL32
(
p
->
buf
)
!=
MKTAG
(
0x2
,
'd'
,
's'
,
's'
)
&&
AV_RL32
(
p
->
buf
)
!=
MKTAG
(
0x3
,
'd'
,
's'
,
's'
))
return
0
;
return
AVPROBE_SCORE_MAX
;
...
...
@@ -120,12 +121,15 @@ static int dss_read_header(AVFormatContext *s)
DSSDemuxContext
*
ctx
=
s
->
priv_data
;
AVIOContext
*
pb
=
s
->
pb
;
AVStream
*
st
;
int
ret
;
int
ret
,
version
;
st
=
avformat_new_stream
(
s
,
NULL
);
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
version
=
avio_r8
(
pb
);
ctx
->
dss_header_size
=
version
*
DSS_BLOCK_SIZE
;
ret
=
dss_read_metadata_string
(
s
,
DSS_HEAD_OFFSET_AUTHOR
,
DSS_AUTHOR_SIZE
,
"author"
);
if
(
ret
)
...
...
@@ -164,7 +168,7 @@ static int dss_read_header(AVFormatContext *s)
/* Jump over header */
if
(
avio_seek
(
pb
,
DSS_HEADER_SIZE
,
SEEK_SET
)
!=
DSS_HEADER_SIZE
)
if
(
avio_seek
(
pb
,
ctx
->
dss_header_size
,
SEEK_SET
)
!=
ctx
->
dss_header_size
)
return
AVERROR
(
EIO
);
ctx
->
counter
=
0
;
...
...
@@ -361,7 +365,7 @@ static int dss_read_seek(AVFormatContext *s, int stream_index,
if
(
seekto
<
0
)
seekto
=
0
;
seekto
+=
DSS_HEADER_SIZE
;
seekto
+=
ctx
->
dss_header_size
;
ret
=
avio_seek
(
s
->
pb
,
seekto
,
SEEK_SET
);
if
(
ret
<
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