Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2015-04-09 12:35:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bd77f995bfb8761015e6e59ede48f531340d7dab
bd77f995
1 parent
546be092
ignore the unknown flv tag.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
19 行增加
和
2 行删除
trunk/research/librtmp/srs_ingest_rtmp.c
trunk/src/libs/srs_librtmp.cpp
trunk/src/libs/srs_librtmp.hpp
trunk/research/librtmp/srs_ingest_rtmp.c
查看文件 @
bd77f99
...
...
@@ -127,6 +127,12 @@ int proxy(srs_rtmp_t irtmp, srs_rtmp_t ortmp)
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
)
{
srs_human_trace
(
"print packet failed. ret=%d"
,
ret
);
return
ret
;
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
bd77f99
...
...
@@ -1973,6 +1973,11 @@ int srs_utils_parse_timestamp(
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
)
{
...
...
@@ -2324,7 +2329,7 @@ int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* data, int
);
}
else
if
(
type
==
SRS_RTMP_TYPE_SCRIPT
)
{
srs_human_verbose
(
"Data packet type=%s, time=%d, size=%d"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
size
);
srs_human_flv_tag_type2string
(
type
),
timestamp
,
size
);
int
nparsed
=
0
;
while
(
nparsed
<
size
)
{
int
nb_parsed_this
=
0
;
...
...
@@ -2332,7 +2337,7 @@ int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* data, int
if
(
amf0
==
NULL
)
{
break
;
}
nparsed
+=
nb_parsed_this
;
char
*
amf0_str
=
NULL
;
...
...
trunk/src/libs/srs_librtmp.hpp
查看文件 @
bd77f99
...
...
@@ -655,6 +655,12 @@ extern int srs_utils_parse_timestamp(
u_int32_t
time
,
char
type
,
char
*
data
,
int
size
,
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.
...
...
请
注册
或
登录
后发表评论