diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-24 22:11:11 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-24 22:11:11 +0200 |
commit | 5268fb9f7e1bca4b0fc496ff115c253aea724e49 (patch) | |
tree | 8023f45f3538f7966c2f75674a4b14fb4778e79c /src/audio/player.c | |
parent | 9421f64ee86e6aec26e05a45bcfc65edd895a8a8 (diff) |
Fixed threading issues and data races
The most serious problem was that GmRequest's response body was being accessed while the TlsRequest thread was modifying it.
Now the response must always be locked before accessing elsewhere.
There were also inefficient data updates in the media players.
Diffstat (limited to 'src/audio/player.c')
-rw-r--r-- | src/audio/player.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/audio/player.c b/src/audio/player.c index 77c23104..1c8538b4 100644 --- a/src/audio/player.c +++ b/src/audio/player.c | |||
@@ -667,7 +667,7 @@ void updateSourceData_Player(iPlayer *d, const iString *mimeType, const iBlock * | |||
667 | const size_t newSize = size_Block(data); | 667 | const size_t newSize = size_Block(data); |
668 | iAssert(newSize >= oldSize); | 668 | iAssert(newSize >= oldSize); |
669 | /* The old parts cannot have changed. */ | 669 | /* The old parts cannot have changed. */ |
670 | iAssert(memcmp(constData_Block(&input->data), constData_Block(data), oldSize) == 0); | 670 | // iAssert(memcmp(constData_Block(&input->data), constData_Block(data), oldSize) == 0); |
671 | appendData_Block(&input->data, constBegin_Block(data) + oldSize, newSize - oldSize); | 671 | appendData_Block(&input->data, constBegin_Block(data) + oldSize, newSize - oldSize); |
672 | input->isComplete = iFalse; | 672 | input->isComplete = iFalse; |
673 | break; | 673 | break; |