Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0a213ddf
Commit
0a213ddf
authored
Oct 19, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input/curl: use std::string for meta_name
Automatic memory management.
parent
5dc4cbdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
CurlInputPlugin.cxx
src/input/CurlInputPlugin.cxx
+5
-9
No files found.
src/input/CurlInputPlugin.cxx
View file @
0a213ddf
...
...
@@ -158,7 +158,7 @@ struct input_curl {
IcyMetaDataParser
icy
;
/** the stream name from the icy-name response header */
char
*
meta_name
;
std
::
string
meta_name
;
/** the tag object ready to be requested via
input_stream::ReadTag() */
...
...
@@ -170,7 +170,6 @@ struct input_curl {
:
base
(
input_plugin_curl
,
url
,
mutex
,
cond
),
request_headers
(
nullptr
),
paused
(
false
),
meta_name
(
nullptr
),
tag
(
nullptr
)
{}
~
input_curl
();
...
...
@@ -632,8 +631,6 @@ input_curl::~input_curl()
{
delete
tag
;
g_free
(
meta_name
);
input_curl_easy_free_indirect
(
this
);
}
...
...
@@ -736,8 +733,8 @@ copy_icy_tag(struct input_curl *c)
delete
c
->
tag
;
if
(
c
->
meta_name
!=
NULL
&&
!
tag
->
HasType
(
TAG_NAME
))
tag
->
AddItem
(
TAG_NAME
,
c
->
meta_name
);
if
(
!
c
->
meta_name
.
empty
()
&&
!
tag
->
HasType
(
TAG_NAME
))
tag
->
AddItem
(
TAG_NAME
,
c
->
meta_name
.
c_str
()
);
c
->
tag
=
tag
;
}
...
...
@@ -862,13 +859,12 @@ input_curl_headerfunction(void *ptr, size_t size, size_t nmemb, void *stream)
}
else
if
(
g_ascii_strcasecmp
(
name
,
"icy-name"
)
==
0
||
g_ascii_strcasecmp
(
name
,
"ice-name"
)
==
0
||
g_ascii_strcasecmp
(
name
,
"x-audiocast-name"
)
==
0
)
{
g_free
(
c
->
meta_name
);
c
->
meta_name
=
g_strndup
(
value
,
end
-
value
);
c
->
meta_name
.
assign
(
value
,
end
);
delete
c
->
tag
;
c
->
tag
=
new
Tag
();
c
->
tag
->
AddItem
(
TAG_NAME
,
c
->
meta_name
);
c
->
tag
->
AddItem
(
TAG_NAME
,
c
->
meta_name
.
c_str
()
);
}
else
if
(
g_ascii_strcasecmp
(
name
,
"icy-metaint"
)
==
0
)
{
char
buffer
[
64
];
size_t
icy_metaint
;
...
...
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