winlin

use complex handshake for srs play

@@ -48,11 +48,19 @@ int main(int argc, char** argv) @@ -48,11 +48,19 @@ int main(int argc, char** argv)
48 rtmp = srs_rtmp_create("rtmp://127.0.0.1:1935/live/livestream"); 48 rtmp = srs_rtmp_create("rtmp://127.0.0.1:1935/live/livestream");
49 } 49 }
50 50
51 - if (srs_simple_handshake(rtmp) != 0) {  
52 - printf("simple handshake failed.\n");  
53 - goto rtmp_destroy; 51 + if (1) {
  52 + if (srs_complex_handshake(rtmp) != 0) {
  53 + printf("complex handshake failed.\n");
  54 + goto rtmp_destroy;
  55 + }
  56 + printf("complex handshake success\n");
  57 + } else {
  58 + if (srs_simple_handshake(rtmp) != 0) {
  59 + printf("simple handshake failed.\n");
  60 + goto rtmp_destroy;
  61 + }
  62 + printf("simple handshake success\n");
54 } 63 }
55 - printf("simple handshake success\n");  
56 64
57 if (srs_connect_app(rtmp) != 0) { 65 if (srs_connect_app(rtmp) != 0) {
58 printf("connect vhost/app failed.\n"); 66 printf("connect vhost/app failed.\n");