471
472
// do necessary checks right here to make sure the combined request of default values and GET parameters is correct
472
if (!req.hostname.av_len)
473
if (!req.hostname.av_len && !req.fullUrl.av_len)
474
475
RTMP_Log(RTMP_LOGERROR,
475
476
"You must specify a hostname (--host) or url (-r \"rtmp://host[:port]/playpath\") containing a hostname");
476
477
status = "400 Missing Hostname";
477
478
goto filenotfound;
479
if (req.playpath.av_len == 0)
480
if (req.playpath.av_len == 0 && !req.fullUrl.av_len)
481
482
RTMP_Log(RTMP_LOGERROR,
482
483
"You must specify a playpath (--playpath) or url (-r \"rtmp://host[:port]/playpath\") containing a playpath");
484
485
goto filenotfound;;
487
if (req.protocol == RTMP_PROTOCOL_UNDEFINED)
488
if (req.protocol == RTMP_PROTOCOL_UNDEFINED && !req.fullUrl.av_len)
489
490
RTMP_Log(RTMP_LOGWARNING,
490
491
"You haven't specified a protocol (--protocol) or rtmp url (-r), using default protocol RTMP");
491
492
req.protocol = RTMP_PROTOCOL_RTMP;
493
if (req.rtmpport == -1)
494
if (req.rtmpport == -1 && !req.fullUrl.av_len)
495
496
RTMP_Log(RTMP_LOGWARNING,
496
497
"You haven't specified a port (--port) or rtmp url (-r), using default port");
497
498
req.rtmpport = 0;
499
if (req.rtmpport == 0)
500
if (req.rtmpport == 0 && !req.fullUrl.av_len)
501
502
if (req.protocol & RTMP_FEATURE_SSL)
502
503
req.rtmpport = 443;
552
553
RTMP_Log(RTMP_LOGDEBUG, "Setting buffer time to: %dms", req.bufferTime);
553
554
RTMP_Init(&rtmp);
554
555
RTMP_SetBufferMS(&rtmp, req.bufferTime);
555
RTMP_SetupStream(&rtmp, req.protocol, &req.hostname, req.rtmpport, &req.sockshost,
556
&req.playpath, &req.tcUrl, &req.swfUrl, &req.pageUrl, &req.app, &req.auth, &req.swfHash, req.swfSize, &req.flashVer, &req.subscribepath, &req.usherToken, dSeek, req.dStopOffset,
557
req.bLiveStream, req.timeout);
556
if (!req.fullUrl.av_len)
558
RTMP_SetupStream(&rtmp, req.protocol, &req.hostname, req.rtmpport, &req.sockshost,
559
&req.playpath, &req.tcUrl, &req.swfUrl, &req.pageUrl, &req.app, &req.auth, &req.swfHash, req.swfSize, &req.flashVer, &req.subscribepath, &req.usherToken, dSeek, req.dStopOffset,
560
req.bLiveStream, req.timeout);
564
if (RTMP_SetupURL(&rtmp, req.fullUrl.av_val) == FALSE)
566
RTMP_Log(RTMP_LOGERROR, "Couldn't parse URL: %s", req.fullUrl.av_val);
558
570
/* backward compatibility, we always sent this as true before */
559
571
if (req.auth.av_len)
560
572
rtmp.Link.lFlags |= RTMP_LF_AUTH;
927
942
STR2AVAL(req->auth, arg);
930
parseAMF(&req->extras, optarg, &req->edepth);
945
parseAMF(&req->extras, arg, &req->edepth);
933
948
req->timeout = atoi(arg);
1050
1066
("\nThis program serves media content streamed from RTMP onto HTTP.\n\n");
1051
1067
RTMP_LogPrintf("--help|-h Prints this help screen.\n");
1069
("--url|-i url URL with options included (e.g. rtmp://host[:port]/path swfUrl=url tcUrl=url)\n");
1053
1071
("--rtmp|-r url URL (e.g. rtmp://host[:port]/path)\n");
1055
1073
("--host|-n hostname Overrides the hostname in the rtmp url\n");