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
9209ccfa
Commit
9209ccfa
authored
Aug 31, 2011
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp_client: allow parameter "kd" to be NULL
When the caller isn't interested in the values.
parent
2525d32e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
8 deletions
+17
-8
raop_output_plugin.c
src/output/raop_output_plugin.c
+2
-2
rtsp_client.c
src/rtsp_client.c
+15
-5
rtsp_client.h
src/rtsp_client.h
+0
-1
No files found.
src/output/raop_output_plugin.c
View file @
9209ccfa
...
...
@@ -756,7 +756,7 @@ raop_output_cancel(void *data)
kd
.
data
=
buf
;
kd
.
next
=
NULL
;
exec_request
(
rd
->
rtspcl
,
"FLUSH"
,
NULL
,
NULL
,
1
,
&
kd
,
&
(
rd
->
rtspcl
->
kd
)
,
NULL
);
&
kd
,
NULL
,
NULL
);
g_mutex_unlock
(
rd
->
control_mutex
);
}
...
...
@@ -815,7 +815,7 @@ raop_output_close(void *data)
g_mutex_lock
(
rd
->
control_mutex
);
exec_request
(
rd
->
rtspcl
,
"TEARDOWN"
,
NULL
,
NULL
,
0
,
NULL
,
&
rd
->
rtspcl
->
kd
,
NULL
);
NULL
,
NULL
,
NULL
);
g_mutex_unlock
(
rd
->
control_mutex
);
rd
->
started
=
0
;
...
...
src/rtsp_client.c
View file @
9209ccfa
...
...
@@ -265,7 +265,6 @@ void
rtspcl_close
(
struct
rtspcl_data
*
rtspcld
)
{
rtspcl_disconnect
(
rtspcld
);
free_kd
(
rtspcld
->
kd
);
rtspcl_remove_all_exthds
(
rtspcld
);
g_free
(
rtspcld
->
session
);
g_free
(
rtspcld
);
...
...
@@ -350,7 +349,6 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd,
const
char
delimiters
[]
=
" "
;
char
*
token
,
*
dp
;
int
dsize
=
0
,
rval
;
struct
key_data
*
cur_kd
=
*
kd
;
int
timeout
=
5000
;
// msec unit
fd_set
rdfds
;
...
...
@@ -437,6 +435,15 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd,
return
false
;
}
/* if the caller isn't interested in response headers, put
them on the trash, which is freed before returning from
this function */
struct
key_data
*
trash
=
NULL
;
if
(
kd
==
NULL
)
kd
=
&
trash
;
struct
key_data
*
cur_kd
=
*
kd
;
struct
key_data
*
new_kd
=
NULL
;
while
(
read_line
(
rtspcld
->
fd
,
line
,
sizeof
(
line
),
timeout
,
0
)
>
0
)
{
timeout
=
1000
;
// once it started, it shouldn't take a long time
...
...
@@ -473,6 +480,9 @@ exec_request(struct rtspcl_data *rtspcld, const char *cmd,
cur_kd
=
new_kd
;
}
}
free_kd
(
trash
);
return
true
;
}
...
...
@@ -481,7 +491,7 @@ rtspcl_set_parameter(struct rtspcl_data *rtspcld, const char *parameter,
GError
**
error_r
)
{
return
exec_request
(
rtspcld
,
"SET_PARAMETER"
,
"text/parameters"
,
parameter
,
1
,
NULL
,
&
rtspcld
->
kd
,
error_r
);
parameter
,
1
,
NULL
,
NULL
,
error_r
);
}
void
...
...
@@ -495,7 +505,7 @@ rtspcl_announce_sdp(struct rtspcl_data *rtspcld, const char *sdp,
GError
**
error_r
)
{
return
exec_request
(
rtspcld
,
"ANNOUNCE"
,
"application/sdp"
,
sdp
,
1
,
NULL
,
&
rtspcld
->
kd
,
error_r
);
NULL
,
NULL
,
error_r
);
}
bool
...
...
@@ -598,7 +608,7 @@ rtspcl_record(struct rtspcl_data *rtspcld,
range
.
next
=
&
rtp
;
return
exec_request
(
rtspcld
,
"RECORD"
,
NULL
,
NULL
,
1
,
&
range
,
&
rtspcld
->
kd
,
error_r
);
NULL
,
error_r
);
}
char
*
...
...
src/rtsp_client.h
View file @
9209ccfa
...
...
@@ -45,7 +45,6 @@ struct rtspcl_data {
int
fd
;
char
url
[
128
];
int
cseq
;
struct
key_data
*
kd
;
struct
key_data
*
exthds
;
char
*
session
;
char
*
transport
;
...
...
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