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
3b9f8e7c
Commit
3b9f8e7c
authored
Oct 15, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/segment: simplify segment_count update
Now segment_count mark the segment_count of the current segment.
parent
ccfb550b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
segment.c
libavformat/segment.c
+4
-6
No files found.
libavformat/segment.c
View file @
3b9f8e7c
...
...
@@ -187,7 +187,6 @@ static int segment_start(AVFormatContext *s, int write_header)
seg
->
segment_idx
++
;
if
((
err
=
set_segment_filename
(
s
))
<
0
)
return
err
;
seg
->
segment_count
++
;
if
((
err
=
avio_open2
(
&
oc
->
pb
,
oc
->
filename
,
AVIO_FLAG_WRITE
,
&
s
->
interrupt_callback
,
NULL
))
<
0
)
...
...
@@ -594,7 +593,6 @@ static int seg_write_header(AVFormatContext *s)
if
((
ret
=
set_segment_filename
(
s
))
<
0
)
goto
fail
;
seg
->
segment_count
++
;
if
(
seg
->
write_header_trailer
)
{
if
((
ret
=
avio_open2
(
&
oc
->
pb
,
oc
->
filename
,
AVIO_FLAG_WRITE
,
...
...
@@ -641,13 +639,13 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
int
ret
;
if
(
seg
->
times
)
{
end_pts
=
seg
->
segment_count
<
=
seg
->
nb_times
?
seg
->
times
[
seg
->
segment_count
-
1
]
:
INT64_MAX
;
end_pts
=
seg
->
segment_count
<
seg
->
nb_times
?
seg
->
times
[
seg
->
segment_count
]
:
INT64_MAX
;
}
else
if
(
seg
->
frames
)
{
start_frame
=
seg
->
segment_count
<=
seg
->
nb_frames
?
seg
->
frames
[
seg
->
segment_count
-
1
]
:
INT_MAX
;
seg
->
frames
[
seg
->
segment_count
]
:
INT_MAX
;
}
else
{
end_pts
=
seg
->
time
*
seg
->
segment_count
;
end_pts
=
seg
->
time
*
(
seg
->
segment_count
+
1
)
;
}
av_dlog
(
s
,
"packet stream:%d pts:%s pts_time:%s is_key:%d frame:%d
\n
"
,
...
...
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