Closed Bug 1309886 Opened 8 years ago Closed 8 years ago

Received tracks don't end after removal and renegotiation

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: pehrsons, Assigned: pehrsons)

References

Details

Attachments

(2 files)

MediaStreamTrack's "ended" event landed in bug 1208373 but I just noticed a track doesn't end at the receiver after being removed at the sender and renegotiated.
Rank: 25
Priority: -- → P2
I noticed this because the patches on bug 1305949 started to permafail test_peerConnection_addtrack_removetrack_events.html.

Turned out we were hooking up the MediaStreamVideoSink in media element to a track that was marked as live but didn't receive any more data.

Ending it properly moves the sink to the first live track.
Blocks: 1305949
Comment on attachment 8800656 [details]
Bug 1309886 - End received tracks when MediaPipelineReceive is detached.

https://reviewboard.mozilla.org/r/85534/#review84222

LGTM
Attachment #8800656 - Flags: review?(drno) → review+
Comment on attachment 8800655 [details]
Bug 1309886 - Check that pre-renegotiation track ends in test_pc_addtrack_removetrack_events.html.

https://reviewboard.mozilla.org/r/85532/#review84232

Looks good after if fixed or explained why no fixing needed :-)

::: dom/media/tests/mochitest/test_peerConnection_addtrack_removetrack_events.html:35
(Diff revision 1)
>            test.pcLocal.removeSender(videoSenderIndex);
>            test.pcLocal.attachLocalTrack(stream.getTracks()[0], localStream);

If I'm not mistaken these two lines are causing the actual swapping. Shouldn't that be moved to the end of the function below the eventsPromise line?

::: dom/media/tests/mochitest/test_peerConnection_addtrack_removetrack_events.html:58
(Diff revision 1)
> +              .find(t => t.kind == "video");
> +          ok(remoteTrack, "Should have received remote track");
> +          const endedPromise = haveEvent(remoteTrack, "ended",
> +              wait(50000, new Error("No ended event")));
> +
> +          eventsPromise = Promise.all([addTrackPromise, endedPromise]);

Is it on purpose that the promise is not returned here?
I would have expected that we wait for both promises to get resolved, before the next test step gets executed. I think without returning this there is no guarantee that any of these actually get resolved before the test finishes.
Attachment #8800655 - Flags: review?(drno) → review+
Comment on attachment 8800655 [details]
Bug 1309886 - Check that pre-renegotiation track ends in test_pc_addtrack_removetrack_events.html.

https://reviewboard.mozilla.org/r/85532/#review84232

> If I'm not mistaken these two lines are causing the actual swapping. Shouldn't that be moved to the end of the function below the eventsPromise line?

Not needed since it takes the whole renegotiation before we start seeing things on the remote side.

> Is it on purpose that the promise is not returned here?
> I would have expected that we wait for both promises to get resolved, before the next test step gets executed. I think without returning this there is no guarantee that any of these actually get resolved before the test finishes.

It's checked after the renegotiation is complete further down in the file.
Pushed by pehrsons@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/47cf46bd3e3e
Check that pre-renegotiation track ends in test_pc_addtrack_removetrack_events.html. r=drno
https://hg.mozilla.org/integration/autoland/rev/227c9d7813e6
End received tracks when MediaPipelineReceive is detached. r=drno
https://hg.mozilla.org/mozilla-central/rev/47cf46bd3e3e
https://hg.mozilla.org/mozilla-central/rev/227c9d7813e6
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Depends on: 1319440
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: