From 055caa25a5c68856afdb97e52160e3fe1d27a55d Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 2 Jun 2009 09:54:16 +1200 Subject: [PATCH] Bug 495319. Fire 'timeupdate' with the correct final time when we finish playing. r=doublec --- content/media/video/src/nsOggDecoder.cpp | 4 +++ content/media/video/test/Makefile.in | 2 ++ content/media/video/test/small-shot.ogg | Bin 0 -> 6399 bytes content/media/video/test/test_bug495319.html | 34 +++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 content/media/video/test/small-shot.ogg create mode 100644 content/media/video/test/test_bug495319.html diff --git a/content/media/video/src/nsOggDecoder.cpp b/content/media/video/src/nsOggDecoder.cpp index 05d6c42c757..05a6be5bb0b 100644 --- a/content/media/video/src/nsOggDecoder.cpp +++ b/content/media/video/src/nsOggDecoder.cpp @@ -1721,6 +1721,9 @@ nsresult nsOggDecodeStateMachine::Run() continue; } + // Set the right current time + mCurrentFrameTime += mCallbackPeriod; + mon.Exit(); nsCOMPtr event = NS_NEW_RUNNABLE_METHOD(nsOggDecoder, mDecoder, PlaybackEnded); @@ -2185,6 +2188,7 @@ void nsOggDecoder::PlaybackEnded() if (mShuttingDown || mPlayState == nsOggDecoder::PLAY_STATE_SEEKING) return; + PlaybackPositionChanged(); ChangeState(PLAY_STATE_ENDED); if (mElement) { diff --git a/content/media/video/test/Makefile.in b/content/media/video/test/Makefile.in index 8fda8ef991c..5c638246af6 100644 --- a/content/media/video/test/Makefile.in +++ b/content/media/video/test/Makefile.in @@ -74,6 +74,7 @@ _TEST_FILES += \ test_bug493187.html \ test_bug495145.html \ test_bug495300.html \ + test_bug495319.html \ test_can_play_type_ogg.html \ test_closing_connections.html \ test_contentDuration1.html \ @@ -112,6 +113,7 @@ _TEST_FILES += \ contentDuration5.sjs \ contentDuration6.sjs \ seek.ogv \ + small-shot.ogg \ sound.ogg \ $(NULL) diff --git a/content/media/video/test/small-shot.ogg b/content/media/video/test/small-shot.ogg new file mode 100644 index 0000000000000000000000000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a7i=syT0G&f{JA?YM8zzZn zrvA8&VwBYE=_1Dd^fmHm!v(Qr&^|jMF3zoiVV%?MjKcg}trM`CxyLRydHENrFAP~* ztyRbOVS=bycf2v|VXvB5dZy}(aJKf=xfAAFh7<>!DlcJ0^yNf&UH8`=Cz% literal 0 HcmV?d00001 diff --git a/content/media/video/test/test_bug495319.html b/content/media/video/test/test_bug495319.html new file mode 100644 index 00000000000..9ced78ee224 --- /dev/null +++ b/content/media/video/test/test_bug495319.html @@ -0,0 +1,34 @@ + + + + + + Bug 495319 - playing back small audio files should fire timeupdate + + + + + +Mozilla Bug 495319 +
+
+
+