1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add gfps and nb_packets

This commit is contained in:
winlin 2015-08-19 15:31:19 +08:00
parent e7714cd445
commit 170ad05148
3 changed files with 25 additions and 24 deletions

View file

@ -258,8 +258,8 @@ int main(int argc, char** argv)
int64_t nb_packets = 0;
u_int32_t pre_timestamp = 0;
int64_t pre_now = srs_utils_time_ms();
int64_t start_time = pre_now;
int64_t pre_now = -1;
int64_t start_time = -1;
for (;;) {
int size;
char type;
@ -271,6 +271,13 @@ int main(int argc, char** argv)
goto rtmp_destroy;
}
if (pre_now == -1) {
pre_now = srs_utils_time_ms();
}
if (start_time == -1) {
start_time = srs_utils_time_ms();
}
if (srs_human_print_rtmp_packet4(type, timestamp, data, size, pre_timestamp, pre_now, start_time, nb_packets++) != 0) {
srs_human_trace("print rtmp packet failed.");
goto rtmp_destroy;