#define VERSION_STR "V1.0"
/* error handling macros */
-#define my_curl_easy_setopt(A, B, C) \
- if((res = curl_easy_setopt((A), (B), (C))) != CURLE_OK) \
+#define my_curl_easy_setopt(A, B, C) \
+ res = curl_easy_setopt((A), (B), (C)); \
+ if(res != CURLE_OK) \
fprintf(stderr, "curl_easy_setopt(%s, %s, %s) failed: %d\n", \
#A, #B, #C, res);
-#define my_curl_easy_perform(A) \
- if((res = curl_easy_perform((A))) != CURLE_OK) \
+#define my_curl_easy_perform(A) \
+ res = curl_easy_perform(A); \
+ if(res != CURLE_OK) \
fprintf(stderr, "curl_easy_perform(%s) failed: %d\n", #A, res);
my_curl_easy_setopt(curl, CURLOPT_RANGE, range);
my_curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, (long)CURL_RTSPREQ_PLAY);
my_curl_easy_perform(curl);
+
+ /* switch off using range again */
+ my_curl_easy_setopt(curl, CURLOPT_RANGE, NULL);
}
printf("\nRTSP request %s\n", VERSION_STR);
printf(" Project web site: http://code.google.com/p/rtsprequest/\n");
- printf(" Requires cURL V7.20 or greater\n\n");
+ printf(" Requires curl V7.20 or greater\n\n");
/* check command line */
if((argc != 2) && (argc != 3)) {
if(res == CURLE_OK) {
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
CURL *curl;
- fprintf(stderr, " cURL V%s loaded\n", data->version);
+ fprintf(stderr, " curl V%s loaded\n", data->version);
/* initialize this curl session */
curl = curl_easy_init();