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

refine code for srs rtmp dump

This commit is contained in:
winlin 2015-08-19 19:02:33 +08:00
parent 785a5907a8
commit ec87dd9cd6
2 changed files with 12 additions and 12 deletions

View file

@ -879,8 +879,8 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
// when not got any messages, timeout. // when not got any messages, timeout.
if (trd->nb_msgs() <= nb_msgs) { if (trd->nb_msgs() <= nb_msgs) {
ret = ERROR_SOCKET_TIMEOUT; ret = ERROR_SOCKET_TIMEOUT;
srs_warn("publish timeout %"PRId64"us, nb_msgs=%"PRId64", ret=%d", srs_warn("publish timeout %dms, nb_msgs=%"PRId64", ret=%d",
SRS_CONSTS_RTMP_RECV_TIMEOUT_US, nb_msgs, ret); nb_msgs? publish_normal_timeout : publish_1stpkt_timeout, nb_msgs, ret);
break; break;
} }
nb_msgs = trd->nb_msgs(); nb_msgs = trd->nb_msgs();

View file

@ -2356,22 +2356,22 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
u_int32_t pts; u_int32_t pts;
if (srs_utils_parse_timestamp(timestamp, type, data, size, &pts) != 0) { if (srs_utils_parse_timestamp(timestamp, type, data, size, &pts) != 0) {
srs_human_trace("Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, diff=%d, ndiff=%d, size=%d, DecodeError", srs_human_trace("Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, ndiff=%d, diff=%d, size=%d, DecodeError",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, diff, ndiff, size nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, ndiff, diff, size
); );
return ret; return ret;
} }
if (type == SRS_RTMP_TYPE_VIDEO) { if (type == SRS_RTMP_TYPE_VIDEO) {
srs_human_trace("Video packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d, %s(%s,%s)", srs_human_trace("Video packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, %s(%s,%s)",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, diff, ndiff, size, nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, ndiff, diff, size,
srs_human_flv_video_codec_id2string(srs_utils_flv_video_codec_id(data, size)), srs_human_flv_video_codec_id2string(srs_utils_flv_video_codec_id(data, size)),
srs_human_flv_video_avc_packet_type2string(srs_utils_flv_video_avc_packet_type(data, size)), srs_human_flv_video_avc_packet_type2string(srs_utils_flv_video_avc_packet_type(data, size)),
srs_human_flv_video_frame_type2string(srs_utils_flv_video_frame_type(data, size)) srs_human_flv_video_frame_type2string(srs_utils_flv_video_frame_type(data, size))
); );
} else if (type == SRS_RTMP_TYPE_AUDIO) { } else if (type == SRS_RTMP_TYPE_AUDIO) {
srs_human_trace("Audio packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d, %s(%s,%s,%s,%s)", srs_human_trace("Audio packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, %s(%s,%s,%s,%s)",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, diff, ndiff, size, nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, ndiff, diff, size,
srs_human_flv_audio_sound_format2string(srs_utils_flv_audio_sound_format(data, size)), srs_human_flv_audio_sound_format2string(srs_utils_flv_audio_sound_format(data, size)),
srs_human_flv_audio_sound_rate2string(srs_utils_flv_audio_sound_rate(data, size)), srs_human_flv_audio_sound_rate2string(srs_utils_flv_audio_sound_rate(data, size)),
srs_human_flv_audio_sound_size2string(srs_utils_flv_audio_sound_size(data, size)), srs_human_flv_audio_sound_size2string(srs_utils_flv_audio_sound_size(data, size)),
@ -2379,8 +2379,8 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
srs_human_flv_audio_aac_packet_type2string(srs_utils_flv_audio_aac_packet_type(data, size)) srs_human_flv_audio_aac_packet_type2string(srs_utils_flv_audio_aac_packet_type(data, size))
); );
} else if (type == SRS_RTMP_TYPE_SCRIPT) { } else if (type == SRS_RTMP_TYPE_SCRIPT) {
srs_human_verbose("Data packet id=%"PRId64"/%.1f/%.1f, type=%s, time=%d, diff=%d, ndiff=%d, size=%d", srs_human_verbose("Data packet id=%"PRId64"/%.1f/%.1f, type=%s, time=%d, ndiff=%d, diff=%d, size=%d",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, diff, ndiff, size); nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, ndiff, diff, size);
int nparsed = 0; int nparsed = 0;
while (nparsed < size) { while (nparsed < size) {
int nb_parsed_this = 0; int nb_parsed_this = 0;
@ -2396,8 +2396,8 @@ int srs_human_print_rtmp_packet4(char type, u_int32_t timestamp, char* data, int
srs_freep(amf0_str); srs_freep(amf0_str);
} }
} else { } else {
srs_human_trace("Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%#x, dts=%d, pts=%d, diff=%d, ndiff=%d, size=%d", srs_human_trace("Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%#x, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d",
nb_packets, pi, gfps, type, timestamp, pts, diff, ndiff, size); nb_packets, pi, gfps, type, timestamp, pts, ndiff, diff, size);
} }
return ret; return ret;