MediaFilePlayer: use BString for fName attribute

This commit is contained in:
Dario Casalinuovo
2015-07-09 23:45:17 +02:00
parent 8208641822
commit 1363ef8d85
2 changed files with 3 additions and 4 deletions
+1 -3
View File
@@ -61,13 +61,12 @@ PlayMediaFile(const char* media_type, const char* media_name)
MediaFilePlayer::MediaFilePlayer(const char* media_type,
const char* media_name, entry_ref* ref)
:
fName(media_name),
fInitCheck(B_ERROR),
fRef(*ref),
fSoundPlayer(NULL),
fPlayTrack(NULL)
{
fName = strdup(media_name);
fPlayFile = new BMediaFile(&fRef);
fInitCheck = fPlayFile->InitCheck();
if (fInitCheck != B_OK)
@@ -111,7 +110,6 @@ MediaFilePlayer::~MediaFilePlayer()
{
delete fSoundPlayer;
delete fPlayFile;
free(fName);
}
+2 -1
View File
@@ -11,6 +11,7 @@
#include <MediaFile.h>
#include <MediaTrack.h>
#include <SoundPlayer.h>
#include <String.h>
void PlayMediaFile(const char* media_type, const char* media_name);
@@ -38,7 +39,7 @@ public:
const media_raw_audio_format& format);
private:
char* fName;
BString fName;
status_t fInitCheck;
entry_ref fRef;
BSoundPlayer* fSoundPlayer;