FFMPEG Copyright(): Fix memory leak
Fix a memory leak I introduced. Followed Stippi's suggestion. Thanks!
This commit is contained in:
@@ -18,7 +18,6 @@
|
|||||||
#include <MediaDefs.h>
|
#include <MediaDefs.h>
|
||||||
#include <MediaFormats.h>
|
#include <MediaFormats.h>
|
||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <String.h>
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
@@ -1453,6 +1452,7 @@ AVFormatReader::Stream::Seek(uint32 flags, int64* frame, bigtime_t* time)
|
|||||||
|
|
||||||
AVFormatReader::AVFormatReader()
|
AVFormatReader::AVFormatReader()
|
||||||
:
|
:
|
||||||
|
fCopyright(""),
|
||||||
fStreams(NULL),
|
fStreams(NULL),
|
||||||
fSourceLock("source I/O lock")
|
fSourceLock("source I/O lock")
|
||||||
{
|
{
|
||||||
@@ -1481,14 +1481,12 @@ AVFormatReader::~AVFormatReader()
|
|||||||
const char*
|
const char*
|
||||||
AVFormatReader::Copyright()
|
AVFormatReader::Copyright()
|
||||||
{
|
{
|
||||||
BMessage* message = new BMessage();
|
if (fCopyright.Length() <= 0) {
|
||||||
if (GetMetaData(message) == B_OK) {
|
BMessage message;
|
||||||
const char* copyright;
|
if (GetMetaData(&message) == B_OK)
|
||||||
if (message->FindString("copyright", ©right) == B_OK)
|
message.FindString("copyright", &fCopyright);
|
||||||
return copyright;
|
|
||||||
}
|
}
|
||||||
delete message;
|
return fCopyright.String();
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
#include "ReaderPlugin.h"
|
#include "ReaderPlugin.h"
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
class Stream;
|
class Stream;
|
||||||
|
|
||||||
|
BString fCopyright;
|
||||||
Stream** fStreams;
|
Stream** fStreams;
|
||||||
BLocker fSourceLock;
|
BLocker fSourceLock;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user