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
951561b6
Commit
951561b6
authored
Apr 08, 2019
by
joepadmiraal
Committed by
Karthick J
Apr 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libavformat/dashenc : Prevent writing manifest files multiple times
parent
4d2f6215
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
dashenc.c
libavformat/dashenc.c
+18
-1
No files found.
libavformat/dashenc.c
View file @
951561b6
...
@@ -145,6 +145,8 @@ typedef struct DASHContext {
...
@@ -145,6 +145,8 @@ typedef struct DASHContext {
int
ignore_io_errors
;
int
ignore_io_errors
;
int
lhls
;
int
lhls
;
int
master_publish_rate
;
int
master_publish_rate
;
int
nr_of_streams_to_flush
;
int
nr_of_streams_flushed
;
}
DASHContext
;
}
DASHContext
;
static
struct
codec_string
{
static
struct
codec_string
{
...
@@ -1089,6 +1091,7 @@ static int dash_init(AVFormatContext *s)
...
@@ -1089,6 +1091,7 @@ static int dash_init(AVFormatContext *s)
char
*
ptr
;
char
*
ptr
;
char
basename
[
1024
];
char
basename
[
1024
];
c
->
nr_of_streams_to_flush
=
0
;
if
(
c
->
single_file_name
)
if
(
c
->
single_file_name
)
c
->
single_file
=
1
;
c
->
single_file
=
1
;
if
(
c
->
single_file
)
if
(
c
->
single_file
)
...
@@ -1302,12 +1305,18 @@ static int dash_init(AVFormatContext *s)
...
@@ -1302,12 +1305,18 @@ static int dash_init(AVFormatContext *s)
os
->
max_pts
=
AV_NOPTS_VALUE
;
os
->
max_pts
=
AV_NOPTS_VALUE
;
os
->
last_dts
=
AV_NOPTS_VALUE
;
os
->
last_dts
=
AV_NOPTS_VALUE
;
os
->
segment_index
=
1
;
os
->
segment_index
=
1
;
if
(
s
->
streams
[
i
]
->
codecpar
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
c
->
nr_of_streams_to_flush
++
;
}
}
if
(
!
c
->
has_video
&&
c
->
seg_duration
<=
0
)
{
if
(
!
c
->
has_video
&&
c
->
seg_duration
<=
0
)
{
av_log
(
s
,
AV_LOG_WARNING
,
"no video stream and no seg duration set
\n
"
);
av_log
(
s
,
AV_LOG_WARNING
,
"no video stream and no seg duration set
\n
"
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
c
->
nr_of_streams_flushed
=
0
;
return
0
;
return
0
;
}
}
...
@@ -1616,8 +1625,16 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
...
@@ -1616,8 +1625,16 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
}
}
}
}
}
}
if
(
ret
>=
0
)
if
(
ret
>=
0
)
{
if
(
c
->
has_video
)
{
c
->
nr_of_streams_flushed
++
;
if
(
c
->
nr_of_streams_flushed
!=
c
->
nr_of_streams_to_flush
)
return
ret
;
c
->
nr_of_streams_flushed
=
0
;
}
ret
=
write_manifest
(
s
,
final
);
ret
=
write_manifest
(
s
,
final
);
}
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