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
6cfd5366
Commit
6cfd5366
authored
Mar 01, 2015
by
Timo Rothenpieler
Committed by
Michael Niedermayer
Mar 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashenc: Update codec_str on extradata_size change
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
b86af8da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
dashenc.c
libavformat/dashenc.c
+17
-1
No files found.
libavformat/dashenc.c
View file @
6cfd5366
...
@@ -72,6 +72,7 @@ typedef struct OutputStream {
...
@@ -72,6 +72,7 @@ typedef struct OutputStream {
int
bit_rate
;
int
bit_rate
;
char
bandwidth_str
[
64
];
char
bandwidth_str
[
64
];
int
codec_str_extradata_size
;
char
codec_str
[
100
];
char
codec_str
[
100
];
}
OutputStream
;
}
OutputStream
;
...
@@ -501,6 +502,13 @@ static int write_manifest(AVFormatContext *s, int final)
...
@@ -501,6 +502,13 @@ static int write_manifest(AVFormatContext *s, int final)
if
(
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
)
if
(
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
)
continue
;
continue
;
if
(
os
->
codec_str_extradata_size
!=
st
->
codec
->
extradata_size
)
{
memset
(
os
->
codec_str
,
0
,
sizeof
(
os
->
codec_str
));
set_codec_str
(
s
,
st
->
codec
,
os
->
codec_str
,
sizeof
(
os
->
codec_str
));
os
->
codec_str_extradata_size
=
st
->
codec
->
extradata_size
;
}
avio_printf
(
out
,
"
\t\t\t
<Representation id=
\"
%d
\"
mimeType=
\"
video/mp4
\"
codecs=
\"
%s
\"
%s width=
\"
%d
\"
height=
\"
%d
\"
>
\n
"
,
i
,
os
->
codec_str
,
os
->
bandwidth_str
,
st
->
codec
->
width
,
st
->
codec
->
height
);
avio_printf
(
out
,
"
\t\t\t
<Representation id=
\"
%d
\"
mimeType=
\"
video/mp4
\"
codecs=
\"
%s
\"
%s width=
\"
%d
\"
height=
\"
%d
\"
>
\n
"
,
i
,
os
->
codec_str
,
os
->
bandwidth_str
,
st
->
codec
->
width
,
st
->
codec
->
height
);
output_segment_list
(
&
c
->
streams
[
i
],
out
,
c
);
output_segment_list
(
&
c
->
streams
[
i
],
out
,
c
);
avio_printf
(
out
,
"
\t\t\t
</Representation>
\n
"
);
avio_printf
(
out
,
"
\t\t\t
</Representation>
\n
"
);
...
@@ -515,6 +523,13 @@ static int write_manifest(AVFormatContext *s, int final)
...
@@ -515,6 +523,13 @@ static int write_manifest(AVFormatContext *s, int final)
if
(
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
)
if
(
st
->
codec
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
)
continue
;
continue
;
if
(
os
->
codec_str_extradata_size
!=
st
->
codec
->
extradata_size
)
{
memset
(
os
->
codec_str
,
0
,
sizeof
(
os
->
codec_str
));
set_codec_str
(
s
,
st
->
codec
,
os
->
codec_str
,
sizeof
(
os
->
codec_str
));
os
->
codec_str_extradata_size
=
st
->
codec
->
extradata_size
;
}
avio_printf
(
out
,
"
\t\t\t
<Representation id=
\"
%d
\"
mimeType=
\"
audio/mp4
\"
codecs=
\"
%s
\"
%s audioSamplingRate=
\"
%d
\"
>
\n
"
,
i
,
os
->
codec_str
,
os
->
bandwidth_str
,
st
->
codec
->
sample_rate
);
avio_printf
(
out
,
"
\t\t\t
<Representation id=
\"
%d
\"
mimeType=
\"
audio/mp4
\"
codecs=
\"
%s
\"
%s audioSamplingRate=
\"
%d
\"
>
\n
"
,
i
,
os
->
codec_str
,
os
->
bandwidth_str
,
st
->
codec
->
sample_rate
);
avio_printf
(
out
,
"
\t\t\t\t
<AudioChannelConfiguration schemeIdUri=
\"
urn:mpeg:dash:23003:3:audio_channel_configuration:2011
\"
value=
\"
%d
\"
/>
\n
"
,
st
->
codec
->
channels
);
avio_printf
(
out
,
"
\t\t\t\t
<AudioChannelConfiguration schemeIdUri=
\"
urn:mpeg:dash:23003:3:audio_channel_configuration:2011
\"
value=
\"
%d
\"
/>
\n
"
,
st
->
codec
->
channels
);
output_segment_list
(
&
c
->
streams
[
i
],
out
,
c
);
output_segment_list
(
&
c
->
streams
[
i
],
out
,
c
);
...
@@ -649,7 +664,8 @@ static int dash_write_header(AVFormatContext *s)
...
@@ -649,7 +664,8 @@ static int dash_write_header(AVFormatContext *s)
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
else
if
(
st
->
codec
->
codec_type
==
AVMEDIA_TYPE_AUDIO
)
c
->
has_audio
=
1
;
c
->
has_audio
=
1
;
set_codec_str
(
s
,
os
->
ctx
->
streams
[
0
]
->
codec
,
os
->
codec_str
,
sizeof
(
os
->
codec_str
));
set_codec_str
(
s
,
s
->
streams
[
i
]
->
codec
,
os
->
codec_str
,
sizeof
(
os
->
codec_str
));
os
->
codec_str_extradata_size
=
s
->
streams
[
i
]
->
codec
->
extradata_size
;
os
->
first_pts
=
AV_NOPTS_VALUE
;
os
->
first_pts
=
AV_NOPTS_VALUE
;
os
->
max_pts
=
AV_NOPTS_VALUE
;
os
->
max_pts
=
AV_NOPTS_VALUE
;
os
->
segment_index
=
1
;
os
->
segment_index
=
1
;
...
...
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