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
fca08518
Commit
fca08518
authored
Mar 16, 2015
by
Micah Galizia
Committed by
Michael Niedermayer
Mar 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/hls: refactor repeated HLS option updates
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
18a96479
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
16 deletions
+12
-16
hls.c
libavformat/hls.c
+12
-16
No files found.
libavformat/hls.c
View file @
fca08518
...
@@ -903,6 +903,14 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
...
@@ -903,6 +903,14 @@ static void intercept_id3(struct playlist *pls, uint8_t *buf,
pls
->
is_id3_timestamped
=
(
pls
->
id3_mpegts_timestamp
!=
AV_NOPTS_VALUE
);
pls
->
is_id3_timestamped
=
(
pls
->
id3_mpegts_timestamp
!=
AV_NOPTS_VALUE
);
}
}
static
void
update_options
(
char
**
dest
,
const
char
*
name
,
void
*
src
)
{
av_freep
(
dest
);
av_opt_get
(
src
,
name
,
0
,
(
uint8_t
**
)
dest
);
if
(
*
dest
&&
!
strlen
(
*
dest
))
av_freep
(
dest
);
}
static
int
open_input
(
HLSContext
*
c
,
struct
playlist
*
pls
)
static
int
open_input
(
HLSContext
*
c
,
struct
playlist
*
pls
)
{
{
AVDictionary
*
opts
=
NULL
;
AVDictionary
*
opts
=
NULL
;
...
@@ -944,10 +952,7 @@ static int open_input(HLSContext *c, struct playlist *pls)
...
@@ -944,10 +952,7 @@ static int open_input(HLSContext *c, struct playlist *pls)
av_log
(
NULL
,
AV_LOG_ERROR
,
"Unable to read key file %s
\n
"
,
av_log
(
NULL
,
AV_LOG_ERROR
,
"Unable to read key file %s
\n
"
,
seg
->
key
);
seg
->
key
);
}
}
av_freep
(
&
c
->
cookies
);
update_options
(
&
c
->
cookies
,
"cookies"
,
uc
->
priv_data
);
av_opt_get
(
uc
->
priv_data
,
"cookies"
,
0
,
(
uint8_t
**
)
&
(
c
->
cookies
));
if
(
c
->
cookies
&&
!
strlen
(
c
->
cookies
))
av_freep
(
&
c
->
cookies
);
av_dict_set
(
&
opts
,
"cookies"
,
c
->
cookies
,
0
);
av_dict_set
(
&
opts
,
"cookies"
,
c
->
cookies
,
0
);
ffurl_close
(
uc
);
ffurl_close
(
uc
);
}
else
{
}
else
{
...
@@ -1257,22 +1262,13 @@ static int hls_read_header(AVFormatContext *s)
...
@@ -1257,22 +1262,13 @@ static int hls_read_header(AVFormatContext *s)
// if the URL context is good, read important options we must broker later
// if the URL context is good, read important options we must broker later
if
(
u
&&
u
->
prot
->
priv_data_class
)
{
if
(
u
&&
u
->
prot
->
priv_data_class
)
{
// get the previous user agent & set back to null if string size is zero
// get the previous user agent & set back to null if string size is zero
av_freep
(
&
c
->
user_agent
);
update_options
(
&
c
->
user_agent
,
"user-agent"
,
u
->
priv_data
);
av_opt_get
(
u
->
priv_data
,
"user-agent"
,
0
,
(
uint8_t
**
)
&
(
c
->
user_agent
));
if
(
c
->
user_agent
&&
!
strlen
(
c
->
user_agent
))
av_freep
(
&
c
->
user_agent
);
// get the previous cookies & set back to null if string size is zero
// get the previous cookies & set back to null if string size is zero
av_freep
(
&
c
->
cookies
);
update_options
(
&
c
->
cookies
,
"cookies"
,
u
->
priv_data
);
av_opt_get
(
u
->
priv_data
,
"cookies"
,
0
,
(
uint8_t
**
)
&
(
c
->
cookies
));
if
(
c
->
cookies
&&
!
strlen
(
c
->
cookies
))
av_freep
(
&
c
->
cookies
);
// get the previous headers & set back to null if string size is zero
// get the previous headers & set back to null if string size is zero
av_freep
(
&
c
->
headers
);
update_options
(
&
c
->
headers
,
"headers"
,
u
->
priv_data
);
av_opt_get
(
u
->
priv_data
,
"headers"
,
0
,
(
uint8_t
**
)
&
(
c
->
headers
));
if
(
c
->
headers
&&
!
strlen
(
c
->
headers
))
av_freep
(
&
c
->
headers
);
}
}
if
((
ret
=
parse_playlist
(
c
,
s
->
filename
,
NULL
,
s
->
pb
))
<
0
)
if
((
ret
=
parse_playlist
(
c
,
s
->
filename
,
NULL
,
s
->
pb
))
<
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