comparison stream/realrtsp/real.c @ 22749:f088d69b1667

Fix for realrtsp urls with more than 2 streams: - do setup for all the streams we subscribed to - Use all bits of stream id, not only the lsbit Fixes rtsp://vodreal.stanford.edu/opa/philo/061022.rm
author rtogni
date Tue, 20 Mar 2007 22:30:51 +0000
parents 6c1fe779b704
children 8e7b3260e985
comparison
equal deleted inserted replaced
22748:904e3f3f8bee 22749:f088d69b1667
390 #endif 390 #endif
391 size+=2; 391 size+=2;
392 392
393 ph.object_version=0; 393 ph.object_version=0;
394 ph.length=size; 394 ph.length=size;
395 ph.stream_number=(flags1>>1)&1; 395 ph.stream_number=(flags1>>1)&0x1f;
396 ph.timestamp=ts; 396 ph.timestamp=ts;
397 ph.reserved=0; 397 ph.reserved=0;
398 if ((flags2&1) == 0 && (prev_ts != ts || prev_stream_number != ph.stream_number)) 398 if ((flags2&1) == 0 && (prev_ts != ts || prev_stream_number != ph.stream_number))
399 { 399 {
400 prev_ts = ts; 400 prev_ts = ts;
450 char *mrl=rtsp_get_mrl(rtsp_session); 450 char *mrl=rtsp_get_mrl(rtsp_session);
451 unsigned int size; 451 unsigned int size;
452 int status; 452 int status;
453 uint32_t maxbandwidth = bandwidth; 453 uint32_t maxbandwidth = bandwidth;
454 char* authfield = NULL; 454 char* authfield = NULL;
455 int i;
455 456
456 /* get challenge */ 457 /* get challenge */
457 challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1")); 458 challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1"));
458 #ifdef LOG 459 #ifdef LOG
459 printf("real: Challenge1: %s\n", challenge1); 460 printf("real: Challenge1: %s\n", challenge1);
589 rtsp_schedule_field(rtsp_session, "Transport: x-pn-tng/tcp;mode=play,rtp/avp/tcp;unicast;mode=play"); 590 rtsp_schedule_field(rtsp_session, "Transport: x-pn-tng/tcp;mode=play,rtp/avp/tcp;unicast;mode=play");
590 buf = xbuffer_ensure_size(buf, strlen(mrl) + 32); 591 buf = xbuffer_ensure_size(buf, strlen(mrl) + 32);
591 sprintf(buf, "%s/streamid=0", mrl); 592 sprintf(buf, "%s/streamid=0", mrl);
592 rtsp_request_setup(rtsp_session,buf,NULL); 593 rtsp_request_setup(rtsp_session,buf,NULL);
593 594
594 if (h->prop->num_streams > 1) { 595 /* Do setup for all the other streams we subscribed to */
596 for (i = 1; i < h->prop->num_streams; i++) {
595 rtsp_schedule_field(rtsp_session, "Transport: x-pn-tng/tcp;mode=play,rtp/avp/tcp;unicast;mode=play"); 597 rtsp_schedule_field(rtsp_session, "Transport: x-pn-tng/tcp;mode=play,rtp/avp/tcp;unicast;mode=play");
596 buf = xbuffer_ensure_size(buf, strlen(session_id) + 32); 598 buf = xbuffer_ensure_size(buf, strlen(session_id) + 32);
597 sprintf(buf, "If-Match: %s", session_id); 599 sprintf(buf, "If-Match: %s", session_id);
598 rtsp_schedule_field(rtsp_session, buf); 600 rtsp_schedule_field(rtsp_session, buf);
599 601
600 buf = xbuffer_ensure_size(buf, strlen(mrl) + 32); 602 buf = xbuffer_ensure_size(buf, strlen(mrl) + 32);
601 sprintf(buf, "%s/streamid=1", mrl); 603 sprintf(buf, "%s/streamid=%d", mrl, i);
602 rtsp_request_setup(rtsp_session,buf,NULL); 604 rtsp_request_setup(rtsp_session,buf,NULL);
603 } 605 }
604 /* set stream parameter (bandwidth) with our subscribe string */ 606 /* set stream parameter (bandwidth) with our subscribe string */
605 rtsp_schedule_field(rtsp_session, subscribe); 607 rtsp_schedule_field(rtsp_session, subscribe);
606 rtsp_request_setparameter(rtsp_session,NULL); 608 rtsp_request_setparameter(rtsp_session,NULL);