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
wenjiegit
2014-01-02 13:26:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e959bb6c5c06c3df1402b0506c39c9b551f89d28
e959bb6c
1 parent
3af83fb0
fixbug[play packet decode bug: srs only read bool type play reset value, actuall…
…y this value can be bool or number]
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
30 行增加
和
9 行删除
trunk/src/core/srs_core_protocol.cpp
trunk/src/core/srs_core_protocol.cpp
查看文件 @
e959bb6
/*
The MIT License (MIT)
Copyright (c) 2013 winlin
Copyright (c) 2013
-2014
winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
...
...
@@ -282,8 +282,6 @@ messages.
/****************************************************************************
*****************************************************************************
****************************************************************************/
// when got a messae header, increase recv timeout to got an entire message.
#define SRS_MIN_RECV_TIMEOUT_US 3000
SrsProtocol
::
AckWindowSize
::
AckWindowSize
()
{
...
...
@@ -2399,12 +2397,35 @@ int SrsPlayPacket::decode(SrsStream* stream)
srs_error
(
"amf0 decode play duration failed. ret=%d"
,
ret
);
return
ret
;
}
if
(
!
stream
->
empty
()
&&
(
ret
=
srs_amf0_read_boolean
(
stream
,
reset
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"amf0 decode play reset failed. ret=%d"
,
ret
);
return
ret
;
}
srs_info
(
"amf0 decode play packet success"
);
SrsAmf0Any
*
any_value
=
NULL
;
if
(
!
stream
->
empty
())
{
if
((
ret
=
srs_amf0_read_any
(
stream
,
any_value
))
!=
ERROR_SUCCESS
)
{
ret
=
ERROR_RTMP_AMF0_DECODE
;
srs_error
(
"amf0 read play reset marker failed. ret=%d"
,
ret
);
return
ret
;
}
else
{
// check if the value is bool or number
// An optional Boolean value or number that specifies whether to flush any previous playlist.
if
(
any_value
->
is_boolean
())
{
SrsAmf0Boolean
*
reset_bool
=
dynamic_cast
<
SrsAmf0Boolean
*>
(
any_value
);
if
(
reset_bool
)
{
reset
=
reset_bool
->
value
;
}
}
else
if
(
any_value
->
is_number
())
{
SrsAmf0Number
*
reset_number
=
dynamic_cast
<
SrsAmf0Number
*>
(
any_value
);
if
(
reset_number
)
{
reset
=
(
reset_number
->
value
==
0
?
false
:
true
);
}
}
else
{
ret
=
ERROR_RTMP_AMF0_DECODE
;
srs_error
(
"amf0 decode play reset not support type. desire number or bool, ret=%d"
,
ret
);
return
ret
;
}
SrsAutoFree
(
SrsAmf0Any
,
any_value
,
false
);
}
}
srs_info
(
"amf0 decode play packet success"
);
return
ret
;
}
...
...
请
注册
或
登录
后发表评论