1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 11:51:57 +00:00

Merge branch 3.0release into develop

This commit is contained in:
winlin 2019-04-06 16:11:18 +08:00
commit f73a17eac3
4 changed files with 21 additions and 9 deletions

View file

@ -162,6 +162,7 @@ Please select according to languages:
### V3 changes
* v3.0, 2019-04-06, Merge [#1304][bug #1304], Fix ST coroutine pull error. 3.0.47
* v3.0, 2019-04-05, Merge [#1339][bug #1339], Support HTTP-FLV params. 3.0.46
* v3.0, 2018-11-11, Merge [#1261][bug #1261], Support `_definst_` for Wowza. 3.0.44
* v3.0, 2018-08-26, SRS [console](https://github.com/ossrs/srs-ngb) support both [Chinese](http://ossrs.net:1985/console/ng_index.html) and [English](http://ossrs.net:1985/console/en_index.html).

View file

@ -101,8 +101,7 @@ srs_error_t SrsSTCoroutine::start()
srs_error_t err = srs_success;
if (started || disposed) {
err = srs_error_new(ERROR_THREAD_DISPOSED,
"failed for disposed=%d, started=%d", disposed, started);
err = srs_error_new(ERROR_THREAD_DISPOSED, "failed for disposed=%d, started=%d", disposed, started);
if (trd_err == srs_success) {
trd_err = srs_error_copy(err);
@ -139,9 +138,11 @@ void SrsSTCoroutine::stop()
srs_assert(!r0);
// Always override the error by the error from worker.
if ((srs_error_t)res != srs_success) {
srs_error_t err_res = (srs_error_t)res;
if (err_res != srs_success && trd_err != err_res) {
srs_freep(trd_err);
trd_err = (srs_error_t)res;
// It's ok to directly use it, because it's returned by st_thread_join.
trd_err = err_res;
return;
}
@ -198,7 +199,17 @@ srs_error_t SrsSTCoroutine::cycle()
void* SrsSTCoroutine::pfn(void* arg)
{
SrsSTCoroutine* p = (SrsSTCoroutine*)arg;
void* res = (void*)p->cycle();
return res;
srs_error_t err = p->cycle();
// Set the err for function pull to fetch it.
// @see https://github.com/ossrs/srs/pull/1304#issuecomment-480484151
if (err != srs_success) {
srs_freep(p->trd_err);
// It's ok to directly use it, because it's returned by st_thread_join.
p->trd_err = err;
}
return (void*)err;
}

View file

@ -27,7 +27,7 @@
// current release version
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
#define VERSION_REVISION 46
#define VERSION_REVISION 47
// generated by configure, only macros.
#include <srs_auto_headers.hpp>

View file

@ -2095,13 +2095,13 @@ VOID TEST(KernelUtility, AdtsUtils)
}
if (true) {
char data[] = {0xFF, 0x00};
uint8_t data[] = {0xFF, 0x00};
SrsBuffer buf((char*)data, sizeof(data));
EXPECT_TRUE(!srs_aac_startswith_adts(&buf));
}
if (true) {
char data[] = {0xFF, 0xF0};
uint8_t data[] = {0xFF, 0xF0};
SrsBuffer buf((char*)data, sizeof(data));
EXPECT_TRUE(srs_aac_startswith_adts(&buf));
}