1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-03-09 23:38:56 +00:00

miracle-srcctl: fix some warming

This commit is contained in:
Derek Dai 2017-01-04 14:12:23 +08:00
parent 853152cb9c
commit 1919de3158
No known key found for this signature in database
GPG key ID: E109CC97553EF009
4 changed files with 13 additions and 23 deletions

View file

@ -70,6 +70,8 @@ static int src_trigger_play_rep_fn(struct rtsp *bus,
void *data)
{
cli_debug("INCOMING (M5): %s\n", rtsp_message_get_raw(m));
return 0;
}
static void src_handle_setup(struct ctl_src *s,
@ -236,7 +238,7 @@ static bool parse_video_formats(struct rtsp_message *m,
formats->hres = -1;
formats->vres = -1;
sscanf(param + 55, "%hx %hx", &formats->hres, &formats->vres);
sscanf(param + 55, "%x %x", &formats->hres, &formats->vres);
return true;
@ -322,7 +324,6 @@ static int src_trigger_setup_rep_fn(struct rtsp *bus,
{
struct ctl_src *s = data;
_rtsp_message_unref_ struct rtsp_message *req = NULL;
int r;
cli_debug("INCOMING (M5): %s\n", rtsp_message_get_raw(m));
@ -335,7 +336,7 @@ static int src_trigger_setup_rep_fn(struct rtsp *bus,
ctl_src_close(s);
ctl_fn_src_disconnected(s);
return r;
return 0;
}
static int src_set_parameter_rep_fn(struct rtsp *bus,
@ -439,16 +440,16 @@ static int src_get_parameter_rep_fn(struct rtsp *bus,
void *data)
{
struct ctl_src *s = data;
int r;
const char *param;
int n_params;
cli_debug("INCOMING (M3): %s\n", rtsp_message_get_raw(m));
if (!rtsp_message_is_reply(m, RTSP_CODE_OK, NULL)) {
cli_printf("[" CLI_RED "ERROR" CLI_DEFAULT "] GET_PARAMETER failed\n");
r = -1;
goto error;
ctl_src_close(s);
ctl_fn_src_disconnected(s);
return -EINVAL;
}
free(s->sink.rtp_ports.profile);
@ -458,15 +459,7 @@ static int src_get_parameter_rep_fn(struct rtsp *bus,
//s->sink.has_audio_codecs = parse_audio_codecs(m, &s->sink.audio_codecs);
s->sink.has_rtp_ports = parse_client_rtp_ports(m, &s->sink.rtp_ports);
r = src_send_set_parameter(s);
return 0;
error:
ctl_src_close(s);
ctl_fn_src_disconnected(s);
return -EINVAL;
return src_send_set_parameter(s);
}
static int src_options_rep_fn(struct rtsp *bus,
@ -607,7 +600,6 @@ static void src_connected(struct ctl_src *s)
int r, val;
struct sockaddr_storage addr;
socklen_t len;
char buf[64];
cli_printf("got incomming connection request\n");

View file

@ -54,7 +54,6 @@ static sd_event_source *scan_timeout;
static sd_event_source *src_timeout;
static unsigned int src_timeout_time;
static bool src_connected;
static pid_t src_pid;
//static char *selected_ link;
static struct ctl_link *running_link;

View file

@ -191,7 +191,7 @@ int vfd_get_vesa_resolution(uint32_t mask, int *hres, int *vres)
if (!mask)
return -EINVAL;
for (N_ELEMENTS(resolutions_vesa) - 1; i >= 0; --i) {
for (i = N_ELEMENTS(resolutions_vesa) - 1; i >= 0; --i) {
if ((1 << resolutions_vesa[i].index) & mask) {
*vres = resolutions_vesa[i].vres;
*hres = resolutions_vesa[i].hres;
@ -208,7 +208,7 @@ int vfd_get_hh_resolution(uint32_t mask, int *hres, int *vres)
if (!mask)
return -EINVAL;
for (N_ELEMENTS(resolutions_hh); i >= 0; --i) {
for (i = N_ELEMENTS(resolutions_hh); i >= 0; --i) {
if ((1 << resolutions_hh[i].index) & mask) {
*vres = resolutions_hh[i].vres;
*hres = resolutions_hh[i].hres;

View file

@ -828,7 +828,6 @@ static int manager_dbus_enumerate(sd_bus *bus,
struct peer *p;
size_t i, peer_cnt;
char **nodes, *node;
int r;
if(strcmp("/org/freedesktop/miracle/wifi", path)) {
return 0;
@ -887,7 +886,7 @@ error:
while (i--)
free(nodes[i]);
free(nodes);
return r;
return log_ENOMEM();
}
int manager_dbus_connect(struct manager *m)