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
ee109c6b
Commit
ee109c6b
authored
Oct 10, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dtshd: fix seeking
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
73ad355d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
dtshddec.c
libavformat/dtshddec.c
+8
-6
No files found.
libavformat/dtshddec.c
View file @
ee109c6b
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
#define TIMECODE 0x54494D45434F4445
#define TIMECODE 0x54494D45434F4445
typedef
struct
DTSHDDemuxContext
{
typedef
struct
DTSHDDemuxContext
{
uint64_t
left
;
uint64_t
data_end
;
}
DTSHDDemuxContext
;
}
DTSHDDemuxContext
;
static
int
dtshd_probe
(
AVProbeData
*
p
)
static
int
dtshd_probe
(
AVProbeData
*
p
)
...
@@ -79,7 +79,9 @@ static int dtshd_read_header(AVFormatContext *s)
...
@@ -79,7 +79,9 @@ static int dtshd_read_header(AVFormatContext *s)
switch
(
chunk_type
)
{
switch
(
chunk_type
)
{
case
STRMDATA
:
case
STRMDATA
:
dtshd
->
left
=
chunk_size
;
dtshd
->
data_end
=
chunk_size
+
avio_tell
(
pb
);
if
(
dtshd
->
data_end
<=
chunk_size
)
return
AVERROR_INVALIDDATA
;
return
0
;
return
0
;
break
;
break
;
case
FILEINFO
:
case
FILEINFO
:
...
@@ -107,11 +109,12 @@ skip:
...
@@ -107,11 +109,12 @@ skip:
static
int
raw_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
raw_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
{
DTSHDDemuxContext
*
dtshd
=
s
->
priv_data
;
DTSHDDemuxContext
*
dtshd
=
s
->
priv_data
;
uint64_t
size
;
int64_t
size
,
left
;
int
ret
;
int
ret
;
size
=
FFMIN
(
dtshd
->
left
,
1024
);
left
=
dtshd
->
data_end
-
avio_tell
(
s
->
pb
);
if
(
size
==
0
)
size
=
FFMIN
(
left
,
1024
);
if
(
size
<=
0
)
return
AVERROR_EOF
;
return
AVERROR_EOF
;
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
size
);
ret
=
av_get_packet
(
s
->
pb
,
pkt
,
size
);
...
@@ -119,7 +122,6 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -119,7 +122,6 @@ static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)
return
ret
;
return
ret
;
pkt
->
stream_index
=
0
;
pkt
->
stream_index
=
0
;
dtshd
->
left
-=
ret
;
return
ret
;
return
ret
;
}
}
...
...
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