Closed Bug 1081766 Opened 10 years ago Closed 10 years ago

clean up MediaSourceReader/TrackBuffer shutdown a bit

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: karlt, Assigned: karlt)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

TrackBuffer::Shutdown() is run from MediaSourceReader::Shutdown(), while the
MDStateMachine shuts down its mDecodeTaskQueue.

MediaSourceReader::BreakCycles() later runs on the main thread from
MDStateMachine's nsDecoderDisposeEvent.
It tries to call BreakCycles on each TrackBuffer, but mTrackBuffers is already
empty from Shutdown.

TrackBuffer::BreakCycles() would try to call BreakCycles on
mDecoders[i]->GetReader(), but mDecoders is already empty from Shutdown().
Clearing tracks after Shutdown of TrackBuffers means they are cleared
after any more can be added.
Attachment #8503838 - Flags: review?(kinetik)
I don't know of real problems fixed in these patches.  They provide that BreakCycles will run on the readers, make it clearer what happens when, and simplify the code a little.
Attachment #8503838 - Flags: review?(kinetik) → review+
Attachment #8503839 - Flags: review?(kinetik) → review+
Attachment #8503840 - Flags: review?(kinetik) → review+
Attachment #8503841 - Flags: review?(kinetik) → review+
Attachment #8503842 - Flags: review?(kinetik) → review+
You need to log in before you can comment on or make changes to this bug.