1.1 --- a/gmyth/src/gmyth_remote_util.c Thu Jun 14 18:19:52 2007 +0100
1.2 +++ b/gmyth/src/gmyth_remote_util.c Wed Aug 22 14:55:41 2007 +0100
1.3 @@ -43,45 +43,46 @@
1.4 *
1.5 * @return the remote encoder instance available, or NULL if any error happens.
1.6 */
1.7 -GMythRecorder *
1.8 +GMythRecorder *
1.9 remote_request_next_free_recorder(GMythSocket * socket, gint curr)
1.10 {
1.11 - GMythRecorder *recorder = NULL;
1.12 - GString *hostname;
1.13 - gint num, port;
1.14 + GMythRecorder *recorder = NULL;
1.15 + GString *hostname;
1.16 + gint num,
1.17 + port;
1.18
1.19 - GMythStringList *strlist = gmyth_string_list_new();
1.20 + GMythStringList *strlist = gmyth_string_list_new();
1.21
1.22 - gmyth_debug("[%s] Request next free recorder in the backend", __FUNCTION__);
1.23 + gmyth_debug("[%s] Request next free recorder in the backend",
1.24 + __FUNCTION__);
1.25
1.26 - gmyth_string_list_append_char_array(strlist, "GET_NEXT_FREE_RECORDER");
1.27 - gmyth_string_list_append_int(strlist, curr);
1.28 + gmyth_string_list_append_char_array(strlist, "GET_NEXT_FREE_RECORDER");
1.29 + gmyth_string_list_append_int(strlist, curr);
1.30
1.31 - if (!gmyth_socket_sendreceive_stringlist(socket, strlist))
1.32 - {
1.33 - g_warning("GET_NEXT_FREE_RECORDER request error!\n");
1.34 - return NULL;
1.35 - }
1.36 + if (!gmyth_socket_sendreceive_stringlist(socket, strlist)) {
1.37 + g_warning("GET_NEXT_FREE_RECORDER request error!\n");
1.38 + return NULL;
1.39 + }
1.40
1.41 - num = gmyth_string_list_get_int(strlist, 0);
1.42 - hostname = gmyth_string_list_get_string(strlist, 1);
1.43 - port = gmyth_string_list_get_int(strlist, 2);
1.44 + num = gmyth_string_list_get_int(strlist, 0);
1.45 + hostname = gmyth_string_list_get_string(strlist, 1);
1.46 + port = gmyth_string_list_get_int(strlist, 2);
1.47
1.48 - if (num < 0 || port < 0)
1.49 - goto clean_up;
1.50 + if (num < 0 || port < 0)
1.51 + goto clean_up;
1.52
1.53 - gmyth_debug
1.54 - ("[%s] Free recorder info received: num: %d, hostname: %s, port: %d",
1.55 - __FUNCTION__, num, hostname->str, port);
1.56 + gmyth_debug
1.57 + ("[%s] Free recorder info received: num: %d, hostname: %s, port: %d",
1.58 + __FUNCTION__, num, hostname->str, port);
1.59
1.60 - recorder = gmyth_recorder_new(num, hostname, port);
1.61 + recorder = gmyth_recorder_new(num, hostname, port);
1.62
1.63 -clean_up:
1.64 + clean_up:
1.65
1.66 - g_string_free(hostname, TRUE);
1.67 - g_object_unref(strlist);
1.68 + g_string_free(hostname, TRUE);
1.69 + g_object_unref(strlist);
1.70
1.71 - return recorder;
1.72 + return recorder;
1.73 }
1.74
1.75 /**
1.76 @@ -94,31 +95,32 @@
1.77 gint
1.78 gmyth_remote_util_get_free_recorder_count(GMythSocket * socket)
1.79 {
1.80 - gint num_recs = 0;
1.81 + gint num_recs = 0;
1.82
1.83 - GMythStringList *strlist = gmyth_string_list_new();
1.84 + GMythStringList *strlist = gmyth_string_list_new();
1.85
1.86 - gmyth_debug("[%s] Request next free recorder in the backend", __FUNCTION__);
1.87 + gmyth_debug("[%s] Request next free recorder in the backend",
1.88 + __FUNCTION__);
1.89
1.90 - gmyth_string_list_append_char_array(strlist, "GET_FREE_RECORDER_COUNT");
1.91 + gmyth_string_list_append_char_array(strlist,
1.92 + "GET_FREE_RECORDER_COUNT");
1.93
1.94 - if (!gmyth_socket_sendreceive_stringlist(socket, strlist))
1.95 - {
1.96 - gmyth_debug("GET_FREE_RECORDER_COUNT request error!");
1.97 - return 0;
1.98 - }
1.99 + if (!gmyth_socket_sendreceive_stringlist(socket, strlist)) {
1.100 + gmyth_debug("GET_FREE_RECORDER_COUNT request error!");
1.101 + return 0;
1.102 + }
1.103
1.104 - num_recs = gmyth_string_list_get_int(strlist, 0);
1.105 + num_recs = gmyth_string_list_get_int(strlist, 0);
1.106
1.107 - if (num_recs < 0)
1.108 - goto clean_up;
1.109 + if (num_recs < 0)
1.110 + goto clean_up;
1.111
1.112 - gmyth_debug("[%s] Free recorder info received: num recorders: %d",
1.113 - __FUNCTION__, num_recs);
1.114 + gmyth_debug("[%s] Free recorder info received: num recorders: %d",
1.115 + __FUNCTION__, num_recs);
1.116
1.117 -clean_up:
1.118 + clean_up:
1.119
1.120 - g_object_unref(strlist);
1.121 + g_object_unref(strlist);
1.122
1.123 - return num_recs;
1.124 + return num_recs;
1.125 }