mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-14 20:15:58 +08:00
避免服务器端返回content-length=0时,TsPlayer不能正确释放的问题
This commit is contained in:
@@ -34,7 +34,12 @@ void TsPlayer::teardown() {
|
||||
void TsPlayer::onResponseCompleted(const SockException &ex) {
|
||||
if (!_play_result) {
|
||||
_play_result = true;
|
||||
onPlayResult(ex);
|
||||
if (!ex && responseBodyTotalSize() == 0 && responseBodySize() == 0) {
|
||||
//if the server does not return any data, it is considered a failure
|
||||
onShutdown(ex);
|
||||
} else {
|
||||
onPlayResult(ex);
|
||||
}
|
||||
} else {
|
||||
onShutdown(ex);
|
||||
}
|
||||
@@ -44,7 +49,7 @@ void TsPlayer::onResponseCompleted(const SockException &ex) {
|
||||
void TsPlayer::onResponseBody(const char *buf, size_t size) {
|
||||
if (!_play_result) {
|
||||
_play_result = true;
|
||||
onPlayResult(SockException(Err_success, "play http-ts success"));
|
||||
onPlayResult(SockException(Err_success, "read http-ts stream successfully"));
|
||||
}
|
||||
if (!_benchmark_mode) {
|
||||
HttpTSPlayer::onResponseBody(buf, size);
|
||||
|
||||
Reference in New Issue
Block a user