mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
ignore the unknown flv tag.
This commit is contained in:
parent
546be09219
commit
bd77f995bf
3 changed files with 19 additions and 2 deletions
|
@ -127,6 +127,12 @@ int proxy(srs_rtmp_t irtmp, srs_rtmp_t ortmp)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!srs_utils_flv_tag_is_ok(type)) {
|
||||||
|
srs_human_trace("ignore invalid flv tag=%d, dts=%d, %d bytes", type, timestamp, size);
|
||||||
|
free(data);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = srs_human_print_rtmp_packet(type, timestamp, data, size)) != 0) {
|
if ((ret = srs_human_print_rtmp_packet(type, timestamp, data, size)) != 0) {
|
||||||
srs_human_trace("print packet failed. ret=%d", ret);
|
srs_human_trace("print packet failed. ret=%d", ret);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -1974,6 +1974,11 @@ int srs_utils_parse_timestamp(
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srs_bool srs_utils_flv_tag_is_ok(char type)
|
||||||
|
{
|
||||||
|
return type == SRS_RTMP_TYPE_AUDIO || type == SRS_RTMP_TYPE_VIDEO || type == SRS_RTMP_TYPE_SCRIPT;
|
||||||
|
}
|
||||||
|
|
||||||
char srs_utils_flv_video_codec_id(char* data, int size)
|
char srs_utils_flv_video_codec_id(char* data, int size)
|
||||||
{
|
{
|
||||||
if (size < 1) {
|
if (size < 1) {
|
||||||
|
|
|
@ -656,6 +656,12 @@ extern int srs_utils_parse_timestamp(
|
||||||
u_int32_t* ppts
|
u_int32_t* ppts
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* whether the flv tag specified by param type is ok.
|
||||||
|
* @return true when tag is video/audio/script-data; otherwise, false.
|
||||||
|
*/
|
||||||
|
extern srs_bool srs_utils_flv_tag_is_ok(char type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* get the CodecID of video tag.
|
* get the CodecID of video tag.
|
||||||
* Codec Identifier. The following values are defined:
|
* Codec Identifier. The following values are defined:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue