summaryrefslogtreecommitdiffstats
path: root/media/base/pipeline_impl.h
diff options
context:
space:
mode:
authoracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 22:34:24 +0000
committeracolwell@chromium.org <acolwell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 22:34:24 +0000
commitbbee17e594c08a4baf9379cdb22b4961a113434f (patch)
tree818c442ee3b3a4271e796e93d22880adee5315f4 /media/base/pipeline_impl.h
parentd691630d58df76b5dfc9d41c7b94d01738eb4c34 (diff)
downloadchromium_src-bbee17e594c08a4baf9379cdb22b4961a113434f.zip
chromium_src-bbee17e594c08a4baf9379cdb22b4961a113434f.tar.gz
chromium_src-bbee17e594c08a4baf9379cdb22b4961a113434f.tar.bz2
Fix clock update behavior at the end of stream.
Sometimes the audio stream is slightly shorter than the video stream. This can result in no audio data being written to the audio device if you seek close to the end of the clip. This causes the pipeline to hang because the video stream hasn't ended, but the clock hasn't been started because no audio data is written to the device. This change makes sure that the clock gets started if the audio stream has ended and we are still waiting for a clock update. I've also included a fix for a related problem where all of the audio data gets written to the device, but clock updates don't occur on playback_delay changes. This was contributing to the issue mentioned above because up to a second worth of audio data can be covered by the playback_delay. If this happens while seeking to within a second of the clip end you won't get clock updates for the audio data. BUG=52887 TEST=PipelineImplTest.AudioStreamShorterThanVideo Review URL: http://codereview.chromium.org/5182008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline_impl.h')
-rw-r--r--media/base/pipeline_impl.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index f0b9c61..86961cf 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -17,7 +17,7 @@
#include "base/scoped_ptr.h"
#include "base/thread.h"
#include "base/time.h"
-#include "media/base/clock_impl.h"
+#include "media/base/clock.h"
#include "media/base/filter_host.h"
#include "media/base/pipeline.h"
@@ -331,7 +331,7 @@ class PipelineImpl : public Pipeline, public FilterHost {
// Reference clock. Keeps track of current playback time. Uses system
// clock and linear interpolation, but can have its time manually set
// by filters.
- ClockImpl clock_;
+ scoped_ptr<Clock> clock_;
// If this value is set to true, then |clock_| is paused and we are waiting
// for an update of the clock greater than or equal to the elapsed time to
@@ -416,6 +416,7 @@ class PipelineImpl : public Pipeline, public FilterHost {
scoped_ptr<PipelineInitState> pipeline_init_state_;
FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, GetBufferedTime);
+ FRIEND_TEST_ALL_PREFIXES(PipelineImplTest, AudioStreamShorterThanVideo);
DISALLOW_COPY_AND_ASSIGN(PipelineImpl);
};