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
2014-01-02 19:09:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
63388e8ac351e7f43e64beff208037b0567c501f
63388e8a
1 parent
65774f1d
merge from wenjie, fix the flower player play bug, play(reset=amf0-number)
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
24 行增加
和
26 行删除
trunk/src/core/srs_core_protocol.cpp
trunk/src/core/srs_core_protocol.cpp
查看文件 @
63388e8
...
...
@@ -2398,33 +2398,31 @@ int SrsPlayPacket::decode(SrsStream* stream)
return
ret
;
}
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
);
}
if
(
stream
->
empty
())
{
return
ret
;
}
SrsAmf0Any
*
reset_value
=
NULL
;
if
((
ret
=
srs_amf0_read_any
(
stream
,
reset_value
))
!=
ERROR_SUCCESS
)
{
ret
=
ERROR_RTMP_AMF0_DECODE
;
srs_error
(
"amf0 read play reset marker failed. ret=%d"
,
ret
);
return
ret
;
}
SrsAutoFree
(
SrsAmf0Any
,
reset_value
,
false
);
// check if the value is bool or number
// An optional Boolean value or number that specifies whether
// to flush any previous playlist
if
(
reset_value
->
is_boolean
())
{
reset
=
srs_amf0_convert
<
SrsAmf0Boolean
>
(
reset_value
)
->
value
;
}
else
if
(
reset_value
->
is_number
())
{
reset
=
(
srs_amf0_convert
<
SrsAmf0Number
>
(
reset_value
)
->
value
==
0
?
false
:
true
);
}
else
{
ret
=
ERROR_RTMP_AMF0_DECODE
;
srs_error
(
"amf0 invalid type=%#x, requires number or bool, ret=%d"
,
reset_value
->
marker
,
ret
);
return
ret
;
}
srs_info
(
"amf0 decode play packet success"
);
return
ret
;
...
...
请
注册
或
登录
后发表评论