Closed Bug 1123269 Opened 9 years ago Closed 9 years ago

Better fix for Crash in mozilla::WMFAudioMFTManager::Output(__int64, nsAutoPtr<mozilla::MediaData>&) when trying to play a mp4 file

Categories

(Core :: Audio/Video, defect)

x86
Windows 8
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox36 --- fixed
firefox37 --- fixed
firefox38 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(1 file)

Spawned from bug 1121876 comment 12.

Better fix for the problem:

This is bad because you're adding coupling between the MFTDecoder and the
WMFAudioMFTManager; the assumption there based on logic here.

So please change this patch so that instead of passing a GUID to
MFTDecoder::SetMediaTypes() for the output type, pass an instance of
IMFMediaType, which we store in MFTDecoder::mOutputSubtype. Since
mOutputSubtypeis no longer a subType, I think we should rename to mOutputType.

In WMFAudioMFTManager::Init(), create an IMFMediaType for the output, and set
MF_MT_MAJOR_TYPE, MF_MT_SUBTYPE, MF_MT_SAMPLE_SIZE and
MF_MT_AUDIO_BITS_PER_SAMPLE on it, and pass that to
MFTDecoder::SetMediaTypes(), which needs to store it.

Then in MFTDecoder::SetOutputType in this loop you can call
IMFAttributes::Compare():
http://msdn.microsoft.com/en-us/library/windows/desktop/bb970349%28v=vs.85%29.aspx
(IMFMediaType inherits from IMFAttributes).

Call Compare on mOutputType, passing in the available outputType.

You need to pass a MF_ATTRIBUTES_MATCH_OUR_ITEMS comparison type for the
comparison to work. Then you will select an appropriate output type.

You also need to change the video path, but for that output type you should
only need the major and sub type set.
Rewrite as per original review. Fix crash should no output configuration be found.
Attachment #8551284 - Flags: review?(cpearce)
Assignee: nobody → jyavenard
Status: NEW → ASSIGNED
Comment on attachment 8551284 [details] [diff] [review]
Better fix for bug 1121876

Review of attachment 8551284 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thanks!
Attachment #8551284 - Flags: review?(cpearce) → review+
https://hg.mozilla.org/mozilla-central/rev/9aa662b2f1b5
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment on attachment 8551284 [details] [diff] [review]
Better fix for bug 1121876

Approval Request Comment
[Feature/regressing bug #]: MSE
[User impact if declined]: Less consistent testing.
[Describe test coverage new/current, TreeHerder]: Landed on m-c.
[Risks and why]: Risk is low; this is mostly refractoring.
[String/UUID change made/needed]: None.
Attachment #8551284 - Flags: approval-mozilla-beta?
Attachment #8551284 - Flags: approval-mozilla-aurora?
Attachment #8551284 - Flags: approval-mozilla-beta?
Attachment #8551284 - Flags: approval-mozilla-beta+
Attachment #8551284 - Flags: approval-mozilla-aurora?
Attachment #8551284 - Flags: approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: