Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
97993237
Commit
97993237
authored
Oct 16, 2014
by
Mika Raento
Committed by
Martin Storsjö
Oct 16, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ismindex: use tfhd default duration if no sample duration
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
460b509a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
ismindex.c
tools/ismindex.c
+19
-4
No files found.
tools/ismindex.c
View file @
97993237
...
@@ -225,7 +225,8 @@ fail:
...
@@ -225,7 +225,8 @@ fail:
return
ret
;
return
ret
;
}
}
static
int64_t
read_trun_duration
(
AVIOContext
*
in
,
int64_t
end
)
static
int64_t
read_trun_duration
(
AVIOContext
*
in
,
int
default_duration
,
int64_t
end
)
{
{
int64_t
ret
=
0
;
int64_t
ret
=
0
;
int64_t
pos
;
int64_t
pos
;
...
@@ -233,7 +234,7 @@ static int64_t read_trun_duration(AVIOContext *in, int64_t end)
...
@@ -233,7 +234,7 @@ static int64_t read_trun_duration(AVIOContext *in, int64_t end)
int
entries
;
int
entries
;
avio_r8
(
in
);
/* version */
avio_r8
(
in
);
/* version */
flags
=
avio_rb24
(
in
);
flags
=
avio_rb24
(
in
);
if
(
!
(
flags
&
MOV_TRUN_SAMPLE_DURATION
))
{
if
(
default_duration
<=
0
&&
!
(
flags
&
MOV_TRUN_SAMPLE_DURATION
))
{
fprintf
(
stderr
,
"No sample duration in trun flags
\n
"
);
fprintf
(
stderr
,
"No sample duration in trun flags
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -244,7 +245,7 @@ static int64_t read_trun_duration(AVIOContext *in, int64_t end)
...
@@ -244,7 +245,7 @@ static int64_t read_trun_duration(AVIOContext *in, int64_t end)
pos
=
avio_tell
(
in
);
pos
=
avio_tell
(
in
);
for
(
i
=
0
;
i
<
entries
&&
pos
<
end
;
i
++
)
{
for
(
i
=
0
;
i
<
entries
&&
pos
<
end
;
i
++
)
{
int
sample_duration
=
0
;
int
sample_duration
=
default_duration
;
if
(
flags
&
MOV_TRUN_SAMPLE_DURATION
)
sample_duration
=
avio_rb32
(
in
);
if
(
flags
&
MOV_TRUN_SAMPLE_DURATION
)
sample_duration
=
avio_rb32
(
in
);
if
(
flags
&
MOV_TRUN_SAMPLE_SIZE
)
avio_rb32
(
in
);
if
(
flags
&
MOV_TRUN_SAMPLE_SIZE
)
avio_rb32
(
in
);
if
(
flags
&
MOV_TRUN_SAMPLE_FLAGS
)
avio_rb32
(
in
);
if
(
flags
&
MOV_TRUN_SAMPLE_FLAGS
)
avio_rb32
(
in
);
...
@@ -265,6 +266,7 @@ static int64_t read_moof_duration(AVIOContext *in, int64_t offset)
...
@@ -265,6 +266,7 @@ static int64_t read_moof_duration(AVIOContext *in, int64_t offset)
int64_t
ret
=
-
1
;
int64_t
ret
=
-
1
;
int32_t
moof_size
,
size
,
tag
;
int32_t
moof_size
,
size
,
tag
;
int64_t
pos
=
0
;
int64_t
pos
=
0
;
int
default_duration
=
0
;
avio_seek
(
in
,
offset
,
SEEK_SET
);
avio_seek
(
in
,
offset
,
SEEK_SET
);
moof_size
=
avio_rb32
(
in
);
moof_size
=
avio_rb32
(
in
);
...
@@ -282,8 +284,21 @@ static int64_t read_moof_duration(AVIOContext *in, int64_t offset)
...
@@ -282,8 +284,21 @@ static int64_t read_moof_duration(AVIOContext *in, int64_t offset)
pos
=
avio_tell
(
in
);
pos
=
avio_tell
(
in
);
size
=
avio_rb32
(
in
);
size
=
avio_rb32
(
in
);
tag
=
avio_rb32
(
in
);
tag
=
avio_rb32
(
in
);
if
(
tag
==
MKBETAG
(
't'
,
'f'
,
'h'
,
'd'
))
{
int
flags
=
0
;
avio_r8
(
in
);
/* version */
flags
=
avio_rb24
(
in
);
avio_rb32
(
in
);
/* track_id */
if
(
flags
&
MOV_TFHD_BASE_DATA_OFFSET
)
avio_rb64
(
in
);
if
(
flags
&
MOV_TFHD_STSD_ID
)
avio_rb32
(
in
);
if
(
flags
&
MOV_TFHD_DEFAULT_DURATION
)
default_duration
=
avio_rb32
(
in
);
}
if
(
tag
==
MKBETAG
(
't'
,
'r'
,
'u'
,
'n'
))
{
if
(
tag
==
MKBETAG
(
't'
,
'r'
,
'u'
,
'n'
))
{
return
read_trun_duration
(
in
,
pos
+
size
);
return
read_trun_duration
(
in
,
default_duration
,
pos
+
size
);
}
}
avio_seek
(
in
,
pos
+
size
,
SEEK_SET
);
avio_seek
(
in
,
pos
+
size
,
SEEK_SET
);
}
}
...
...
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