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

refine the type of RTMP from int to char. add srs_parse_timestamp(), 2.0.19

This commit is contained in:
winlin 2014-11-15 13:20:58 +08:00
parent 9b2da59eeb
commit 7ebca6cb5b
10 changed files with 180 additions and 55 deletions

View file

@ -66,15 +66,19 @@ int main(int argc, char** argv)
srs_lib_trace("play stream success");
for (;;) {
int type, size;
u_int32_t timestamp = 0;
int size;
char type;
char* data;
u_int32_t timestamp, pts;
if (srs_read_packet(rtmp, &type, &timestamp, &data, &size) != 0) {
goto rtmp_destroy;
}
srs_lib_trace("got packet: type=%s, time=%d, size=%d",
srs_type2string(type), timestamp, size);
if (srs_parse_timestamp(timestamp, type, data, size, &pts) != 0) {
goto rtmp_destroy;
}
srs_lib_trace("got packet: type=%s, dts=%d, pts=%d, size=%d",
srs_type2string(type), timestamp, pts, size);
free(data);
}