BMediaFile: Add BUrl SetTo

* Also fix the server version of BUrl constructor
to use a const reference.
This commit is contained in:
Dario Casalinuovo
2016-10-20 02:26:25 +02:00
parent 1c5cb31fef
commit 0c98ab27d3
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -75,7 +75,7 @@ public:
BMediaFile(const BUrl& url);
BMediaFile(const BUrl& url, int32 flags);
// Read-Write streaming constructor
BMediaFile(BUrl destination,
BMediaFile(const BUrl& destination,
const media_file_format* mfi,
int32 flags = 0);
+13 -2
View File
@@ -100,7 +100,7 @@ BMediaFile::BMediaFile(const BUrl& url, int32 flags)
}
BMediaFile::BMediaFile(BUrl destination, const media_file_format* mfi,
BMediaFile::BMediaFile(const BUrl& destination, const media_file_format* mfi,
int32 flags)
{
CALLED();
@@ -135,7 +135,6 @@ BMediaFile::SetTo(BDataIO* destination)
{
CALLED();
// TODO: A BUrl SetTo should be provided
if (destination == NULL)
return B_BAD_VALUE;
@@ -146,6 +145,18 @@ BMediaFile::SetTo(BDataIO* destination)
}
status_t
BMediaFile::SetTo(const BUrl& url)
{
CALLED();
_UnInit();
_InitReader(NULL, &url);
return fErr;
}
BMediaFile::~BMediaFile()
{
CALLED();