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
e2193b53
Commit
e2193b53
authored
Nov 06, 2016
by
Anssi Hannula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hls: Add missing error check for avcodec_parameters_copy()
Signed-off-by:
Anssi Hannula
<
anssi.hannula@iki.fi
>
parent
3d2f6364
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
hls.c
libavformat/hls.c
+21
-6
No files found.
libavformat/hls.c
View file @
e2193b53
...
@@ -1528,9 +1528,13 @@ static void add_stream_to_programs(AVFormatContext *s, struct playlist *pls, AVS
...
@@ -1528,9 +1528,13 @@ static void add_stream_to_programs(AVFormatContext *s, struct playlist *pls, AVS
av_dict_set_int
(
&
stream
->
metadata
,
"variant_bitrate"
,
bandwidth
,
0
);
av_dict_set_int
(
&
stream
->
metadata
,
"variant_bitrate"
,
bandwidth
,
0
);
}
}
static
void
set_stream_info_from_input_stream
(
AVStream
*
st
,
struct
playlist
*
pls
,
AVStream
*
ist
)
static
int
set_stream_info_from_input_stream
(
AVStream
*
st
,
struct
playlist
*
pls
,
AVStream
*
ist
)
{
{
avcodec_parameters_copy
(
st
->
codecpar
,
ist
->
codecpar
);
int
err
;
err
=
avcodec_parameters_copy
(
st
->
codecpar
,
ist
->
codecpar
);
if
(
err
<
0
)
return
err
;
if
(
pls
->
is_id3_timestamped
)
/* custom timestamps via id3 */
if
(
pls
->
is_id3_timestamped
)
/* custom timestamps via id3 */
avpriv_set_pts_info
(
st
,
33
,
1
,
MPEG_TIME_BASE
);
avpriv_set_pts_info
(
st
,
33
,
1
,
MPEG_TIME_BASE
);
...
@@ -1538,11 +1542,15 @@ static void set_stream_info_from_input_stream(AVStream *st, struct playlist *pls
...
@@ -1538,11 +1542,15 @@ static void set_stream_info_from_input_stream(AVStream *st, struct playlist *pls
avpriv_set_pts_info
(
st
,
ist
->
pts_wrap_bits
,
ist
->
time_base
.
num
,
ist
->
time_base
.
den
);
avpriv_set_pts_info
(
st
,
ist
->
pts_wrap_bits
,
ist
->
time_base
.
num
,
ist
->
time_base
.
den
);
st
->
internal
->
need_context_update
=
1
;
st
->
internal
->
need_context_update
=
1
;
return
0
;
}
}
/* add new subdemuxer streams to our context, if any */
/* add new subdemuxer streams to our context, if any */
static
int
update_streams_from_subdemuxer
(
AVFormatContext
*
s
,
struct
playlist
*
pls
)
static
int
update_streams_from_subdemuxer
(
AVFormatContext
*
s
,
struct
playlist
*
pls
)
{
{
int
err
;
while
(
pls
->
n_main_streams
<
pls
->
ctx
->
nb_streams
)
{
while
(
pls
->
n_main_streams
<
pls
->
ctx
->
nb_streams
)
{
int
ist_idx
=
pls
->
n_main_streams
;
int
ist_idx
=
pls
->
n_main_streams
;
AVStream
*
st
=
avformat_new_stream
(
s
,
NULL
);
AVStream
*
st
=
avformat_new_stream
(
s
,
NULL
);
...
@@ -1552,11 +1560,13 @@ static int update_streams_from_subdemuxer(AVFormatContext *s, struct playlist *p
...
@@ -1552,11 +1560,13 @@ static int update_streams_from_subdemuxer(AVFormatContext *s, struct playlist *p
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
st
->
id
=
pls
->
index
;
st
->
id
=
pls
->
index
;
set_stream_info_from_input_stream
(
st
,
pls
,
ist
);
dynarray_add
(
&
pls
->
main_streams
,
&
pls
->
n_main_streams
,
st
);
dynarray_add
(
&
pls
->
main_streams
,
&
pls
->
n_main_streams
,
st
);
add_stream_to_programs
(
s
,
pls
,
st
);
add_stream_to_programs
(
s
,
pls
,
st
);
err
=
set_stream_info_from_input_stream
(
st
,
pls
,
ist
);
if
(
err
<
0
)
return
err
;
}
}
return
0
;
return
0
;
...
@@ -1990,8 +2000,13 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -1990,8 +2000,13 @@ static int hls_read_packet(AVFormatContext *s, AVPacket *pkt)
/* There may be more situations where this would be useful, but this at least
/* There may be more situations where this would be useful, but this at least
* handles newly probed codecs properly (i.e. request_probe by mpegts). */
* handles newly probed codecs properly (i.e. request_probe by mpegts). */
if
(
ist
->
codecpar
->
codec_id
!=
st
->
codecpar
->
codec_id
)
if
(
ist
->
codecpar
->
codec_id
!=
st
->
codecpar
->
codec_id
)
{
set_stream_info_from_input_stream
(
st
,
pls
,
ist
);
ret
=
set_stream_info_from_input_stream
(
st
,
pls
,
ist
);
if
(
ret
<
0
)
{
av_packet_unref
(
pkt
);
return
ret
;
}
}
return
0
;
return
0
;
}
}
...
...
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