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
4a12d1e8
Commit
4a12d1e8
authored
Aug 15, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/segment: compute max list segment duration
This is useful for the M3U8 format incoming patch.
parent
769500c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
segment.c
libavformat/segment.c
+10
-2
No files found.
libavformat/segment.c
View file @
4a12d1e8
...
...
@@ -49,6 +49,7 @@ typedef struct {
char
*
format
;
///< format to use for output segment files
char
*
list
;
///< filename for the segment list file
int
list_size
;
///< number of entries for the segment list file
double
list_max_segment_time
;
///< max segment time in the current list
ListType
list_type
;
///< set the list type
AVIOContext
*
list_pb
;
///< list file put-byte context
char
*
time_str
;
///< segment duration specification string
...
...
@@ -112,8 +113,14 @@ fail:
static
int
segment_list_open
(
AVFormatContext
*
s
)
{
SegmentContext
*
seg
=
s
->
priv_data
;
return
avio_open2
(
&
seg
->
list_pb
,
seg
->
list
,
AVIO_FLAG_WRITE
,
&
s
->
interrupt_callback
,
NULL
);
int
ret
;
ret
=
avio_open2
(
&
seg
->
list_pb
,
seg
->
list
,
AVIO_FLAG_WRITE
,
&
s
->
interrupt_callback
,
NULL
);
if
(
ret
<
0
)
return
ret
;
seg
->
list_max_segment_time
=
0
;
return
ret
;
}
static
void
segment_list_close
(
AVFormatContext
*
s
)
...
...
@@ -147,6 +154,7 @@ static int segment_end(AVFormatContext *s)
}
else
if
(
seg
->
list_type
==
LIST_TYPE_EXT
)
{
avio_printf
(
seg
->
list_pb
,
"%s,%f,%f
\n
"
,
oc
->
filename
,
seg
->
start_time
,
seg
->
end_time
);
}
seg
->
list_max_segment_time
=
FFMAX
(
seg
->
end_time
-
seg
->
start_time
,
seg
->
list_max_segment_time
);
avio_flush
(
seg
->
list_pb
);
}
...
...
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