MediaFile: Correctly delete the source on exit

* The delete flag of BUrl constructors was reset by _Init,
this lead to a zombie thread on the background under certain
conditions.
This commit is contained in:
Dario Casalinuovo
2016-09-07 18:02:34 +02:00
parent c6b4e47a50
commit 95a5e62515
+3 -3
View File
@@ -85,8 +85,8 @@ BMediaFile::BMediaFile(const media_file_format* mfi, int32 flags)
BMediaFile::BMediaFile(const BUrl& url) BMediaFile::BMediaFile(const BUrl& url)
{ {
CALLED(); CALLED();
fDeleteSource = true;
_Init(); _Init();
fDeleteSource = true;
_InitReader(NULL, &url); _InitReader(NULL, &url);
} }
@@ -94,8 +94,8 @@ BMediaFile::BMediaFile(const BUrl& url)
BMediaFile::BMediaFile(const BUrl& url, int32 flags) BMediaFile::BMediaFile(const BUrl& url, int32 flags)
{ {
CALLED(); CALLED();
fDeleteSource = true;
_Init(); _Init();
fDeleteSource = true;
_InitReader(NULL, &url, flags); _InitReader(NULL, &url, flags);
} }
@@ -104,8 +104,8 @@ BMediaFile::BMediaFile(BUrl destination, const media_file_format* mfi,
int32 flags) int32 flags)
{ {
CALLED(); CALLED();
fDeleteSource = true;
_Init(); _Init();
fDeleteSource = true;
_InitWriter(NULL, &destination, mfi, flags); _InitWriter(NULL, &destination, mfi, flags);
// TODO: Implement streaming server support, it's // TODO: Implement streaming server support, it's
// a pretty complex thing compared to client mode // a pretty complex thing compared to client mode