Skip to content

Commit

Permalink
Style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-bennett committed Mar 2, 2022
1 parent 588397b commit 77e8264
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions plugins/janus_streaming.c
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ typedef struct janus_streaming_rtp_source {
janus_streaming_buffer *curldata;
char *rtsp_url;
char *rtsp_username, *rtsp_password;
char *rtsp_stream_uri;
char *rtsp_stream_uri;
gint64 ka_timeout;
char *rtsp_ahost, *rtsp_vhost;
gboolean reconnecting;
Expand Down Expand Up @@ -5796,7 +5796,7 @@ static void janus_streaming_rtp_source_free(janus_streaming_rtp_source *source)
g_free(source->rtsp_url);
g_free(source->rtsp_username);
g_free(source->rtsp_password);
curl_free(source->rtsp_stream_uri);
g_free(source->rtsp_stream_uri);
g_free(source->rtsp_ahost);
g_free(source->rtsp_vhost);
janus_mutex_unlock(&source->rtsp_mutex);
Expand Down Expand Up @@ -6522,16 +6522,16 @@ static int janus_streaming_rtsp_connect_to_server(janus_streaming_mountpoint *mp
long code = 0;
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code);
#if CURL_AT_LEAST_VERSION(7, 62, 0)
if(code == 404) { //Possibly a quirk in the RTSP server, where the DESCRIBE request expects a path only.
CURLU *curl_u;
char *path;
curl_u = curl_url();
if(code == 404) {
/*Possibly a quirk in the RTSP server, where the DESCRIBE request expects a path only.*/
CURLU *curl_u = curl_url();
char *path = NULL;
if(!(curl_url_set(curl_u, CURLUPART_URL, source->rtsp_url, 0))) {
if(!(curl_url_get(curl_u, CURLUPART_PATH, &path, 0))) {
curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, path);
res = curl_easy_perform(curl);
source->rtsp_stream_uri = path;
//curl_free(path);
source->rtsp_stream_uri = g_strdup(path);
curl_free(path);
res = curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code);
}
}
Expand Down Expand Up @@ -7092,10 +7092,7 @@ static int janus_streaming_rtsp_play(janus_streaming_rtp_source *source) {
source->curldata->buffer = g_malloc0(1);
source->curldata->size = 0;
JANUS_LOG(LOG_VERB, "Sending PLAY request...\n");
if(source->rtsp_stream_uri)
curl_easy_setopt(source->curl, CURLOPT_RTSP_STREAM_URI, source->rtsp_stream_uri);
else
curl_easy_setopt(source->curl, CURLOPT_RTSP_STREAM_URI, source->rtsp_url);
curl_easy_setopt(source->curl, CURLOPT_RTSP_STREAM_URI, source->rtsp_stream_uri ? source->rtsp_stream_uri : source->rtsp_url);
curl_easy_setopt(source->curl, CURLOPT_RANGE, "npt=0.000-");
curl_easy_setopt(source->curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);
int res = curl_easy_perform(source->curl);
Expand Down

0 comments on commit 77e8264

Please sign in to comment.