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
1e791ee3
Commit
1e791ee3
authored
Nov 05, 2015
by
Paul B Mahol
Committed by
Vittorio Giovara
Nov 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
segafilm: set video and audio stream duration
Signed-off-by:
Vittorio Giovara
<
vittorio.giovara@gmail.com
>
parent
c012c6f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
segafilm.c
libavformat/segafilm.c
+9
-1
No files found.
libavformat/segafilm.c
View file @
1e791ee3
...
@@ -89,6 +89,7 @@ static int film_read_header(AVFormatContext *s)
...
@@ -89,6 +89,7 @@ static int film_read_header(AVFormatContext *s)
int
i
,
ret
;
int
i
,
ret
;
unsigned
int
data_offset
;
unsigned
int
data_offset
;
unsigned
int
audio_frame_counter
;
unsigned
int
audio_frame_counter
;
unsigned
int
video_frame_counter
;
film
->
sample_table
=
NULL
;
film
->
sample_table
=
NULL
;
...
@@ -212,7 +213,7 @@ static int film_read_header(AVFormatContext *s)
...
@@ -212,7 +213,7 @@ static int film_read_header(AVFormatContext *s)
avpriv_set_pts_info
(
st
,
64
,
1
,
film
->
audio_samplerate
);
avpriv_set_pts_info
(
st
,
64
,
1
,
film
->
audio_samplerate
);
}
}
audio_frame_counter
=
0
;
audio_frame_counter
=
video_frame_counter
=
0
;
for
(
i
=
0
;
i
<
film
->
sample_count
;
i
++
)
{
for
(
i
=
0
;
i
<
film
->
sample_count
;
i
++
)
{
/* load the next sample record and transfer it to an internal struct */
/* load the next sample record and transfer it to an internal struct */
if
(
avio_read
(
pb
,
scratch
,
16
)
!=
16
)
{
if
(
avio_read
(
pb
,
scratch
,
16
)
!=
16
)
{
...
@@ -240,6 +241,7 @@ static int film_read_header(AVFormatContext *s)
...
@@ -240,6 +241,7 @@ static int film_read_header(AVFormatContext *s)
film
->
sample_table
[
i
].
stream
=
film
->
video_stream_index
;
film
->
sample_table
[
i
].
stream
=
film
->
video_stream_index
;
film
->
sample_table
[
i
].
pts
=
AV_RB32
(
&
scratch
[
8
])
&
0x7FFFFFFF
;
film
->
sample_table
[
i
].
pts
=
AV_RB32
(
&
scratch
[
8
])
&
0x7FFFFFFF
;
film
->
sample_table
[
i
].
keyframe
=
(
scratch
[
8
]
&
0x80
)
?
0
:
1
;
film
->
sample_table
[
i
].
keyframe
=
(
scratch
[
8
]
&
0x80
)
?
0
:
1
;
video_frame_counter
++
;
av_add_index_entry
(
s
->
streams
[
film
->
video_stream_index
],
av_add_index_entry
(
s
->
streams
[
film
->
video_stream_index
],
film
->
sample_table
[
i
].
sample_offset
,
film
->
sample_table
[
i
].
sample_offset
,
film
->
sample_table
[
i
].
pts
,
film
->
sample_table
[
i
].
pts
,
...
@@ -248,6 +250,12 @@ static int film_read_header(AVFormatContext *s)
...
@@ -248,6 +250,12 @@ static int film_read_header(AVFormatContext *s)
}
}
}
}
if
(
film
->
audio_type
)
s
->
streams
[
film
->
audio_stream_index
]
->
duration
=
audio_frame_counter
;
if
(
film
->
video_type
)
s
->
streams
[
film
->
video_stream_index
]
->
duration
=
video_frame_counter
;
film
->
current_sample
=
0
;
film
->
current_sample
=
0
;
return
0
;
return
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