Closed Bug 1251357 Opened 4 years ago Closed 4 years ago

MediaStreamTrack.stop does not stop the track

Categories

(Core :: WebRTC: Audio/Video, defect, P1)

47 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox46 --- unaffected
firefox47 --- fixed
Blocking Flags:

People

(Reporter: msander, Assigned: jib)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36

Steps to reproduce:

Open http://mozilla.github.io/webrtc-landing/pc_test.html and start the call.

In the console stop the tracks.
localvideo1.mozSrcObject.getTracks().forEach(function(track){track.stop();})
localvideo2.mozSrcObject.getTracks().forEach(function(track){track.stop();})
 


Actual results:

The video stops playing but the camera is still on.


Expected results:

The camera should be released.
Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core
Calling mozSrcObject.stop() releases the camera but gives the deprecated warning.
Confirmed as a regression in nightly builds - branches are fine.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(mreavy)
Keywords: regression
Thanks for the needinfo.  I've asked jib to do the analysis.
Assignee: nobody → jib
backlog: --- → webrtc/webaudio+
Rank: 5
Flags: needinfo?(mreavy)
Priority: -- → P1
I've verified that the commit I mention in comment 4 is indeed the culprit. We can back it out, which will likely bring back the intermittent bug 957691, or I can try to dig in more to figure out what's going on.

FWIW, the workaround for this bug is to wait 20 seconds for garbage collection to kick in, at which point the camera light goes out (I wonder how that plays out in our automated test tree...)
I'm sure it's caused by the removal of this: -  void StopTrack(TrackID aTrackID) override
Perhaps that's been replaced elsewhere in pehrsons huge queue; it may be worthwhile to pull that in and see where stopTrack leads to in his full commit.
Flags: needinfo?(jib)
(In reply to Randell Jesup [:jesup] from comment #6)
> I'm sure it's caused by the removal of this: -  void StopTrack(TrackID
> aTrackID) override

Looks like that's it. Good call.
Flags: needinfo?(jib)
Comment on attachment 8724134 [details]
MozReview Request: Bug 1251357 - fix regression where last MediaStreamTrack.stop did not turn off the camera light.

https://reviewboard.mozilla.org/r/36881/#review33509
Attachment #8724134 - Flags: review?(rjesup) → review+
https://hg.mozilla.org/mozilla-central/rev/04ee9e8be26f
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Blocks: 1248407
You need to log in before you can comment on or make changes to this bug.