From 1caf0cfbe7c0cd19c537c8227246e9d12ef91ec3 Mon Sep 17 00:00:00 2001 From: Duzy Chan Date: Sun, 2 Feb 2014 02:20:30 +0800 Subject: [PATCH] comment out video playback code --- src/Qt/AudioPlaybackThread.cpp | 19 ++++++++++++++++--- src/Qt/PlayerPrivate.cpp | 4 +++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/Qt/AudioPlaybackThread.cpp b/src/Qt/AudioPlaybackThread.cpp index a1dc6108..a8e06575 100644 --- a/src/Qt/AudioPlaybackThread.cpp +++ b/src/Qt/AudioPlaybackThread.cpp @@ -31,6 +31,19 @@ namespace openshot { + struct SafeTimeSliceThread : TimeSliceThread + { + SafeTimeSliceThread(const String & s) : TimeSliceThread(s) {} + void run() + { + try { + TimeSliceThread::run(); + } catch (const TooManySeeks & e) { + // ... + } + } + }; + AudioPlaybackThread::AudioPlaybackThread() : Thread("audio-playback") , audioDeviceManager() @@ -72,15 +85,15 @@ namespace openshot player.setSource(&mixer); // Create TimeSliceThread for audio buffering - TimeSliceThread my_thread("Audio buffer thread"); + SafeTimeSliceThread thread("audio-buffer"); // Start thread - my_thread.startThread(); + thread.startThread(); transport.setSource( source, 10000, // tells it to buffer this many samples ahead - &my_thread, + &thread, sampleRate, numChannels); transport.setPosition(0); diff --git a/src/Qt/PlayerPrivate.cpp b/src/Qt/PlayerPrivate.cpp index 43d16a12..4564c32d 100644 --- a/src/Qt/PlayerPrivate.cpp +++ b/src/Qt/PlayerPrivate.cpp @@ -56,6 +56,7 @@ namespace openshot audioPlayback->setReader(reader); audioPlayback->startThread(1); + /* videoPlayback->startThread(2); //tr1::shared_ptr frame = getFrame(); @@ -82,8 +83,9 @@ namespace openshot std::cout << "frametime: " << ft << " - " << d << " = " << st << std::endl; } - if (audioPlayback->isThreadRunning()) audioPlayback->stopThread(-1); if (videoPlayback->isThreadRunning()) videoPlayback->stopThread(-1); + */ + if (audioPlayback->isThreadRunning()) audioPlayback->stopThread(-1); } tr1::shared_ptr PlayerPrivate::getFrame()