mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix bug #53, never use msg when sent it
This commit is contained in:
parent
0622004eff
commit
cb2959ae7d
1 changed files with 7 additions and 4 deletions
|
@ -520,17 +520,20 @@ int SrsRtmpConn::playing(SrsSource* source)
|
||||||
// so set the msgs[i] to NULL.
|
// so set the msgs[i] to NULL.
|
||||||
msgs[i] = NULL;
|
msgs[i] = NULL;
|
||||||
|
|
||||||
if ((ret = rtmp->send_message(msg)) != ERROR_SUCCESS) {
|
srs_assert(msg);
|
||||||
srs_error("send message to client failed. ret=%d", ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// foreach msg, collect the duration.
|
// foreach msg, collect the duration.
|
||||||
|
// @remark: never use msg when sent it, for the protocol sdk will free it.
|
||||||
if (starttime < 0 || starttime > msg->header.timestamp) {
|
if (starttime < 0 || starttime > msg->header.timestamp) {
|
||||||
starttime = msg->header.timestamp;
|
starttime = msg->header.timestamp;
|
||||||
}
|
}
|
||||||
duration += msg->header.timestamp - starttime;
|
duration += msg->header.timestamp - starttime;
|
||||||
starttime = msg->header.timestamp;
|
starttime = msg->header.timestamp;
|
||||||
|
|
||||||
|
if ((ret = rtmp->send_message(msg)) != ERROR_SUCCESS) {
|
||||||
|
srs_error("send message to client failed. ret=%d", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if duration specified, and exceed it, stop play live.
|
// if duration specified, and exceed it, stop play live.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue