mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine code, failed when specified complex but no ssl for srslibrtmp
This commit is contained in:
parent
0e03d019a8
commit
89a3cf9efe
2 changed files with 10 additions and 5 deletions
|
@ -80,6 +80,9 @@ void parse_amf0_object(char* p, srs_amf0_t args)
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
srs_flv_t flv = NULL;
|
||||
srs_rtmp_t rtmp = NULL;
|
||||
|
||||
printf("dump rtmp stream to flv file\n");
|
||||
printf("srs(simple-rtmp-server) client librtmp library.\n");
|
||||
printf("version: %d.%d.%d\n", srs_version_major(), srs_version_minor(), srs_version_revision());
|
||||
|
@ -184,7 +187,7 @@ int main(int argc, char** argv)
|
|||
srs_human_trace("output to console");
|
||||
}
|
||||
|
||||
srs_rtmp_t rtmp = srs_rtmp_create(rtmp_url);
|
||||
rtmp = srs_rtmp_create(rtmp_url);
|
||||
|
||||
if (__srs_rtmp_dns_resolve(rtmp) != 0) {
|
||||
srs_human_trace("dns resolve failed.");
|
||||
|
@ -227,7 +230,6 @@ int main(int argc, char** argv)
|
|||
}
|
||||
srs_human_trace("play stream success");
|
||||
|
||||
srs_flv_t flv = NULL;
|
||||
if (output_flv) {
|
||||
flv = srs_flv_open_write(output_flv);
|
||||
}
|
||||
|
@ -282,9 +284,7 @@ int main(int argc, char** argv)
|
|||
|
||||
rtmp_destroy:
|
||||
srs_rtmp_destroy(rtmp);
|
||||
if (flv) {
|
||||
srs_flv_close(flv);
|
||||
}
|
||||
srs_human_trace("completed");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -602,6 +602,11 @@ int __srs_rtmp_connect_server(srs_rtmp_t rtmp)
|
|||
|
||||
int __srs_rtmp_do_complex_handshake(srs_rtmp_t rtmp)
|
||||
{
|
||||
#ifndef SRS_AUTO_SSL
|
||||
// complex handshake requires ssl
|
||||
return ERROR_RTMP_HS_SSL_REQUIRE;
|
||||
#endif
|
||||
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_assert(rtmp != NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue