MediaFilePlayer: use BString for fName attribute
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user