Open Bug 1282722 Opened 7 years ago Updated 4 months ago

Add SetSeekThreshold for VPXDecoder

Categories

(Core :: Audio/Video: Playback, defect, P3)

defect

Tracking

()

People

(Reporter: ayang, Unassigned)

References

Details

Attachments

(1 file)

Add SetSeekThreshold for VPXDecoder to increase seek performance.
https://reviewboard.mozilla.org/r/60996/#review58024

::: dom/media/platforms/agnostic/VPXDecoder.cpp:95
(Diff revision 1)
>  nsresult
>  VPXDecoder::Flush()
>  {
>    MOZ_ASSERT(mCallback->OnReaderTaskQueue());
>    mIsFlushing = true;
> -  nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([this] () {
> +  RefPtr<VPXDecoder> self = this;

Why needing to change capture of |this| to |self|?
https://reviewboard.mozilla.org/r/60996/#review58024

> Why needing to change capture of |this| to |self|?

Because this lambda running in a task queue, it needs to take reference to keep VPXDecoder alive.
https://reviewboard.mozilla.org/r/60996/#review58024

> Because this lambda running in a task queue, it needs to take reference to keep VPXDecoder alive.

It is safe to take the raw pointer because Flush() will not return until SynRunnable is finished.
Comment on attachment 8766125 [details]
Bug 1282722: add seek target threshold for VPX decoder.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/60996/diff/1-2/
Comment on attachment 8766125 [details]
Bug 1282722: add seek target threshold for VPX decoder.

https://reviewboard.mozilla.org/r/60996/#review58066

::: dom/media/platforms/agnostic/VPXDecoder.cpp:96
(Diff revision 2)
>  VPXDecoder::Flush()
>  {
>    MOZ_ASSERT(mCallback->OnReaderTaskQueue());
>    mIsFlushing = true;
>    nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([this] () {
> -    // nothing to do for now.
> +    this->mSeekTargetThreshold.reset();

You can save |this->|.
Attachment #8766125 - Flags: review?(jwwang) → review+
Mass change P2 -> P3
Priority: P2 → P3

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: ayang → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.