Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Mueller <nexyon@gmail.com>2010-08-16 15:41:07 +0400
committerJoerg Mueller <nexyon@gmail.com>2010-08-16 15:41:07 +0400
commit25fec1592efade86233c0ba71212dc973b618ad1 (patch)
tree8c6eccaf24d7bf4fa72c5cfc1ca86511d2df0c9d /intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
parenta91d538f47171a40463016b91c22d39d694d923a (diff)
parent2b7a774ab0dfd3bc66240b387a586b5122ab2661 (diff)
Audaspace (GSoC): First merging commit
* All audaspace changes from the GSoC branch including the aud Python module * This commit also includes some minor changes in source/gameengine/Ketsji/KX_PythonInit.cpp: - Fixing names of some constants - removing outdated stopDSP() python function - Autoinclusion of bge instead of GameLogic - Fix for some error messages: GameLogic -> bge.logic
Diffstat (limited to 'intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp')
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp36
1 files changed, 10 insertions, 26 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
index 8e71c97baec..cad64d70790 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp
@@ -24,45 +24,29 @@
*/
// needed for INT64_C
+#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
+#endif
#include "AUD_FFMPEGFactory.h"
#include "AUD_FFMPEGReader.h"
#include "AUD_Buffer.h"
-AUD_FFMPEGFactory::AUD_FFMPEGFactory(const char* filename)
+AUD_FFMPEGFactory::AUD_FFMPEGFactory(std::string filename) :
+ m_filename(filename)
{
- if(filename != NULL)
- {
- m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
- strcpy(m_filename, filename);
- }
- else
- m_filename = NULL;
}
-AUD_FFMPEGFactory::AUD_FFMPEGFactory(unsigned char* buffer, int size)
+AUD_FFMPEGFactory::AUD_FFMPEGFactory(const data_t* buffer, int size) :
+ m_buffer(new AUD_Buffer(size))
{
- m_filename = NULL;
- m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
memcpy(m_buffer.get()->getBuffer(), buffer, size);
}
-AUD_FFMPEGFactory::~AUD_FFMPEGFactory()
-{
- if(m_filename)
- {
- delete[] m_filename; AUD_DELETE("string")
- }
-}
-
-AUD_IReader* AUD_FFMPEGFactory::createReader()
+AUD_IReader* AUD_FFMPEGFactory::createReader() const
{
- AUD_IReader* reader;
- if(m_filename)
- reader = new AUD_FFMPEGReader(m_filename);
+ if(m_buffer.get())
+ return new AUD_FFMPEGReader(m_buffer);
else
- reader = new AUD_FFMPEGReader(m_buffer);
- AUD_NEW("reader")
- return reader;
+ return new AUD_FFMPEGReader(m_filename);
}