Skip to content

Commit

Permalink
audiobridge: fix building without libogg (#3438)
Browse files Browse the repository at this point in the history
* audiobridge: fix build without libogg
* audiobridge: fix warnings without libogg
  • Loading branch information
tmatth authored Sep 30, 2024
1 parent c0d00f6 commit fb9c2cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/janus_audiobridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,7 @@ static struct janus_json_parameter rtp_forward_parameters[] = {
static struct janus_json_parameter stop_rtp_forward_parameters[] = {
{"stream_id", JSON_INTEGER, JANUS_JSON_PARAM_REQUIRED | JANUS_JSON_PARAM_POSITIVE}
};
#ifdef HAVE_LIBOGG
static struct janus_json_parameter play_file_parameters[] = {
{"filename", JSON_STRING, JANUS_JSON_PARAM_REQUIRED},
{"file_id", JSON_STRING, 0},
Expand All @@ -1421,6 +1422,7 @@ static struct janus_json_parameter play_file_parameters[] = {
static struct janus_json_parameter checkstop_file_parameters[] = {
{"file_id", JSON_STRING, JANUS_JSON_PARAM_REQUIRED}
};
#endif
static struct janus_json_parameter suspend_parameters[] = {
{"pause_events", JANUS_JSON_BOOL, 0},
{"stop_record", JANUS_JSON_BOOL, 0},
Expand Down Expand Up @@ -5491,6 +5493,12 @@ static json_t *janus_audiobridge_process_synchronous_request(janus_audiobridge_s
goto prepare_response;
#endif
} else if(!strcasecmp(request_text, "listannouncements")) {
#ifndef HAVE_LIBOGG
JANUS_LOG(LOG_VERB, "Listing announcements unsupported in this instance\n");
error_code = JANUS_AUDIOBRIDGE_ERROR_INVALID_REQUEST;
g_snprintf(error_cause, 512, "Listing announcements unsupported in this instance");
goto prepare_response;
#else
/* List all announcements in a room */
if(!string_ids) {
JANUS_VALIDATE_JSON_OBJECT(root, room_parameters,
Expand Down Expand Up @@ -5561,6 +5569,7 @@ static json_t *janus_audiobridge_process_synchronous_request(janus_audiobridge_s
json_object_set_new(response, "room", string_ids ? json_string(room_id_str) : json_integer(room_id));
json_object_set_new(response, "announcements", list);
goto prepare_response;
#endif
} else if(!strcasecmp(request_text, "stop_file")) {
#ifndef HAVE_LIBOGG
JANUS_LOG(LOG_VERB, "Playing files unsupported in this instance\n");
Expand Down

0 comments on commit fb9c2cc

Please sign in to comment.