summaryrefslogtreecommitdiff
path: root/drivers/theoraplayer/src
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-11-12 11:23:23 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-11-12 11:23:23 -0300
commit6dd8768811cfca5bb831619d93cf870e5d20667f (patch)
tree9e8837b7c8334855a1bce1bd79ab441edde28129 /drivers/theoraplayer/src
parentc8cd5222a7fa931f072e02b23c5b9d826d0ef548 (diff)
3D Import Import & UDP
-=-=-=-=-=-=-=-=-=-=- -Animation Import filter support -Animation Clip import support -Animation Optimizer Fixes, Improvements and Visibile Options -Extremely Experimental UDP support.
Diffstat (limited to 'drivers/theoraplayer/src')
-rw-r--r--drivers/theoraplayer/src/AVFoundation/TheoraVideoClip_AVFoundation.mm3
-rw-r--r--drivers/theoraplayer/src/TheoraVideoClip.cpp2
-rw-r--r--drivers/theoraplayer/src/TheoraVideoManager.cpp14
3 files changed, 14 insertions, 5 deletions
diff --git a/drivers/theoraplayer/src/AVFoundation/TheoraVideoClip_AVFoundation.mm b/drivers/theoraplayer/src/AVFoundation/TheoraVideoClip_AVFoundation.mm
index 8c3d2cc3b9..72e3dfc9fa 100644
--- a/drivers/theoraplayer/src/AVFoundation/TheoraVideoClip_AVFoundation.mm
+++ b/drivers/theoraplayer/src/AVFoundation/TheoraVideoClip_AVFoundation.mm
@@ -271,7 +271,8 @@ void TheoraVideoClip_AVFoundation::load(TheoraDataSource* source)
AVAssetTrack *videoTrack = [tracks objectAtIndex:0];
NSArray* audioTracks = [asset tracksWithMediaType:AVMediaTypeAudio];
- AVAssetTrack *audioTrack = audioTracks.count > 0 ? [audioTracks objectAtIndex:0] : NULL;
+ AVAssetTrack *audioTrack = audioTracks.count > 0 ? [audioTracks objectAtIndex:audio_track] : NULL;
+ printf("*********** using audio track %i\n", audio_track);
#ifdef _AVFOUNDATION_BGRX
bool yuv_output = (mOutputMode != TH_BGRX && mOutputMode != TH_RGBA);
diff --git a/drivers/theoraplayer/src/TheoraVideoClip.cpp b/drivers/theoraplayer/src/TheoraVideoClip.cpp
index b71319e6a1..ed9f2c22da 100644
--- a/drivers/theoraplayer/src/TheoraVideoClip.cpp
+++ b/drivers/theoraplayer/src/TheoraVideoClip.cpp
@@ -51,6 +51,8 @@ TheoraVideoClip::TheoraVideoClip(TheoraDataSource* data_source,
mWaitingForCache(false),
mOutputMode(TH_UNDEFINED)
{
+
+ audio_track=0;
mAudioMutex = NULL;
mThreadAccessMutex = new TheoraMutex();
mTimer = mDefaultTimer = new TheoraTimer();
diff --git a/drivers/theoraplayer/src/TheoraVideoManager.cpp b/drivers/theoraplayer/src/TheoraVideoManager.cpp
index 87696d12a9..53b211374a 100644
--- a/drivers/theoraplayer/src/TheoraVideoManager.cpp
+++ b/drivers/theoraplayer/src/TheoraVideoManager.cpp
@@ -35,6 +35,8 @@ extern "C"
void initYUVConversionModule();
}
+#include "core/os/memory.h"
+
//#define _DECODING_BENCHMARK //uncomment to test average decoding time on a given device
@@ -184,16 +186,18 @@ TheoraAudioInterfaceFactory* TheoraVideoManager::getAudioInterfaceFactory()
TheoraVideoClip* TheoraVideoManager::createVideoClip(std::string filename,
TheoraOutputMode output_mode,
int numPrecachedOverride,
- bool usePower2Stride)
+ bool usePower2Stride,
+ int p_track)
{
- TheoraDataSource* src=new TheoraFileDataSource(filename);
- return createVideoClip(src,output_mode,numPrecachedOverride,usePower2Stride);
+ TheoraDataSource* src=memnew(TheoraFileDataSource(filename));
+ return createVideoClip(src,output_mode,numPrecachedOverride,usePower2Stride, p_track);
}
TheoraVideoClip* TheoraVideoManager::createVideoClip(TheoraDataSource* data_source,
TheoraOutputMode output_mode,
int numPrecachedOverride,
- bool usePower2Stride)
+ bool usePower2Stride,
+ int p_audio_track)
{
mWorkMutex->lock();
@@ -226,6 +230,8 @@ TheoraVideoClip* TheoraVideoManager::createVideoClip(TheoraDataSource* data_sour
#ifdef __FFMPEG
clip = new TheoraVideoClip_FFmpeg(data_source, output_mode, nPrecached, usePower2Stride);
#endif
+
+ clip->set_audio_track(p_audio_track);
clip->load(data_source);
clip->decodeNextFrame(); // ensure the first frame is always preloaded and have the main thread do it to prevent potential thread starvatio