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
2b634e7c
Commit
2b634e7c
authored
Jun 24, 2019
by
Alfred E. Heggestad
Committed by
Karthick J
Jun 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashenc: split extension for MP4 into .mp4 or .m4s
parent
dd662bbd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
dashenc.c
libavformat/dashenc.c
+20
-3
No files found.
libavformat/dashenc.c
View file @
2b634e7c
...
...
@@ -89,6 +89,7 @@ typedef struct OutputStream {
int
bit_rate
;
SegmentType
segment_type
;
/* segment type selected for this particular stream */
const
char
*
format_name
;
const
char
*
extension_name
;
const
char
*
single_file_name
;
/* file names selected for this particular stream */
const
char
*
init_seg_name
;
const
char
*
media_seg_name
;
...
...
@@ -217,6 +218,16 @@ static const char *get_format_str(SegmentType segment_type) {
return
NULL
;
}
static
const
char
*
get_extension_str
(
SegmentType
type
,
int
single_file
)
{
switch
(
type
)
{
case
SEGMENT_TYPE_MP4
:
return
single_file
?
"mp4"
:
"m4s"
;
case
SEGMENT_TYPE_WEBM
:
return
"webm"
;
default:
return
NULL
;
}
}
static
int
handle_io_open_error
(
AVFormatContext
*
s
,
int
err
,
char
*
url
)
{
DASHContext
*
c
=
s
->
priv_data
;
char
errbuf
[
AV_ERROR_MAX_STRING_SIZE
];
...
...
@@ -254,6 +265,12 @@ static int init_segment_types(AVFormatContext *s)
av_log
(
s
,
AV_LOG_ERROR
,
"Could not select DASH segment type for stream %d
\n
"
,
i
);
return
AVERROR_MUXER_NOT_FOUND
;
}
os
->
extension_name
=
get_extension_str
(
segment_type
,
c
->
single_file
);
if
(
!
os
->
extension_name
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Could not get extension type for stream %d
\n
"
,
i
);
return
AVERROR_MUXER_NOT_FOUND
;
}
has_mp4_streams
|=
segment_type
==
SEGMENT_TYPE_MP4
;
}
...
...
@@ -1179,17 +1196,17 @@ static int dash_init(AVFormatContext *s)
return
AVERROR
(
ENOMEM
);
if
(
c
->
init_seg_name
)
{
os
->
init_seg_name
=
av_strireplace
(
c
->
init_seg_name
,
"$ext$"
,
os
->
format
_name
);
os
->
init_seg_name
=
av_strireplace
(
c
->
init_seg_name
,
"$ext$"
,
os
->
extension
_name
);
if
(
!
os
->
init_seg_name
)
return
AVERROR
(
ENOMEM
);
}
if
(
c
->
media_seg_name
)
{
os
->
media_seg_name
=
av_strireplace
(
c
->
media_seg_name
,
"$ext$"
,
os
->
format
_name
);
os
->
media_seg_name
=
av_strireplace
(
c
->
media_seg_name
,
"$ext$"
,
os
->
extension
_name
);
if
(
!
os
->
media_seg_name
)
return
AVERROR
(
ENOMEM
);
}
if
(
c
->
single_file_name
)
{
os
->
single_file_name
=
av_strireplace
(
c
->
single_file_name
,
"$ext$"
,
os
->
format
_name
);
os
->
single_file_name
=
av_strireplace
(
c
->
single_file_name
,
"$ext$"
,
os
->
extension
_name
);
if
(
!
os
->
single_file_name
)
return
AVERROR
(
ENOMEM
);
}
...
...
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