summaryrefslogtreecommitdiffstats
path: root/media/player
diff options
context:
space:
mode:
Diffstat (limited to 'media/player')
-rw-r--r--media/player/movie.cc8
-rw-r--r--media/player/movie.h2
2 files changed, 8 insertions, 2 deletions
diff --git a/media/player/movie.cc b/media/player/movie.cc
index e37a497..2bb4001 100644
--- a/media/player/movie.cc
+++ b/media/player/movie.cc
@@ -79,7 +79,9 @@ bool Movie::Open(const wchar_t* url, WtlVideoRenderer* video_renderer) {
factories->AddFactory(
new media::InstanceFilterFactory<WtlVideoRenderer>(video_renderer));
- pipeline_.reset(new PipelineImpl());
+ thread_.reset(new base::Thread("PipelineThread"));
+ thread_->Start();
+ pipeline_.reset(new PipelineImpl(thread_->message_loop()));
// Create and start our pipeline.
pipeline_->Start(factories.get(), WideToUTF8(std::wstring(url)), NULL);
@@ -194,8 +196,10 @@ bool Movie::GetOpenMpEnable() {
// Teardown.
void Movie::Close() {
if (pipeline_.get()) {
- pipeline_->Stop();
+ pipeline_->Stop(NULL);
+ thread_->Stop();
pipeline_.reset();
+ thread_.reset();
}
}
diff --git a/media/player/movie.h b/media/player/movie.h
index fdaa2b5..eb23822 100644
--- a/media/player/movie.h
+++ b/media/player/movie.h
@@ -11,6 +11,7 @@
#include "base/scoped_ptr.h"
#include "base/singleton.h"
+#include "base/thread.h"
class WtlVideoRenderer;
@@ -90,6 +91,7 @@ class Movie : public Singleton<Movie> {
virtual ~Movie();
scoped_ptr<PipelineImpl> pipeline_;
+ scoped_ptr<base::Thread> thread_;
bool enable_audio_;
bool enable_swscaler_;