mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
refine dvr and rtmp dump, write the original data.
This commit is contained in:
parent
a402ca7120
commit
5661fc2676
6 changed files with 15 additions and 10 deletions
|
@ -843,8 +843,11 @@ int srs_rtmp_read_packet(srs_rtmp_t rtmp, char* type, u_int32_t* timestamp, char
|
|||
// detach bytes from packet.
|
||||
msg->payload = NULL;
|
||||
} else {
|
||||
// ignore and continue
|
||||
continue;
|
||||
*type = msg->header.message_type;
|
||||
*data = (char*)msg->payload;
|
||||
*size = (int)msg->size;
|
||||
// detach bytes from packet.
|
||||
msg->payload = NULL;
|
||||
}
|
||||
|
||||
// got expected message.
|
||||
|
@ -1714,7 +1717,7 @@ int srs_flv_write_tag(srs_flv_t flv, char type, int32_t time, char* data, int si
|
|||
} else if (type == SRS_RTMP_TYPE_VIDEO) {
|
||||
return context->enc.write_video(time, data, size);
|
||||
} else {
|
||||
return context->enc.write_metadata(data, size);
|
||||
return context->enc.write_metadata(type, data, size);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -2476,8 +2479,8 @@ int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* data, int
|
|||
srs_freep(amf0_str);
|
||||
}
|
||||
} else {
|
||||
srs_human_trace("Unknown packet type=%s, dts=%d, pts=%d, size=%d",
|
||||
srs_human_flv_tag_type2string(type), timestamp, pts, size);
|
||||
srs_human_trace("Unknown packet type=%#x, dts=%d, pts=%d, size=%d",
|
||||
type, timestamp, pts, size);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -241,6 +241,7 @@ extern int srs_rtmp_bandwidth_check(srs_rtmp_t rtmp,
|
|||
* SRS_RTMP_TYPE_AUDIO, FlvTagAudio
|
||||
* SRS_RTMP_TYPE_VIDEO, FlvTagVideo
|
||||
* SRS_RTMP_TYPE_SCRIPT, FlvTagScript
|
||||
* otherswise, invalid type.
|
||||
* @param timestamp, in ms, overflow in 50days
|
||||
* @param data, the packet data, according to type:
|
||||
* FlvTagAudio, @see "E.4.2.1 AUDIODATA"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue