winlin

refine the code, add comments to result to self interpret

@@ -154,7 +154,8 @@ rtmp_destroy: @@ -154,7 +154,8 @@ rtmp_destroy:
154 "\"%s\":%d, " // #5 154 "\"%s\":%d, " // #5
155 "\"%s\":%d, " // #6 155 "\"%s\":%d, " // #6
156 "\"%s\":%d, " // #7 156 "\"%s\":%d, " // #7
157 - "%s}", 157 + "\"%s\":%d, " // #8
  158 + "%s%s%s}",
158 // total = dns + tcp_connect + start_play + first_packet + last_packet 159 // total = dns + tcp_connect + start_play + first_packet + last_packet
159 "total", (int)(time_cleanup - time_startup), //#1 160 "total", (int)(time_cleanup - time_startup), //#1
160 "dns", (int)(time_dns_resolve - time_startup), //#2 161 "dns", (int)(time_dns_resolve - time_startup), //#2
@@ -162,12 +163,15 @@ rtmp_destroy: @@ -162,12 +163,15 @@ rtmp_destroy:
162 "start_play", (int)(time_play_stream - time_socket_connect), //#4 163 "start_play", (int)(time_play_stream - time_socket_connect), //#4
163 "first_packet", (int)(time_first_packet - time_play_stream), //#5 164 "first_packet", (int)(time_first_packet - time_play_stream), //#5
164 "last_packet", (int)(time_cleanup - time_first_packet), //#6 165 "last_packet", (int)(time_cleanup - time_first_packet), //#6
  166 + "stream", (int)(timestamp), //#7
165 // expect = time_cleanup - time_first_packet 167 // expect = time_cleanup - time_first_packet
166 - // actual = timestamp 168 + // actual = stream
167 // delay = actual - expect 169 // delay = actual - expect
168 - "delay", (int)(timestamp - (time_cleanup - time_first_packet)), //#7 170 + "delay", (int)(timestamp - (time_cleanup - time_first_packet)), //#8
169 // unit in ms. 171 // unit in ms.
170 - "\"unit\": \"ms\"" 172 + "\"unit\": \"ms\",",
  173 + "\"remark0\": \"total = dns + tcp_connect + start_play + first_packet + last_packet\",",
  174 + "\"remark1\": \"delay = stream - (time_cleanup - time_first_packet)\""
171 ); 175 );
172 printf("\n"); 176 printf("\n");
173 177