Closed Bug 1446929 Opened 8 years ago Closed 8 years ago

dom/media/Benchmark.cpp only supports video

Categories

(Core :: Audio/Video: Playback, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: decoder, Assigned: decoder)

Details

Attachments

(1 file)

Currently, the Benchmark class only seems to support video input judging from this code: https://searchfox.org/mozilla-central/rev/3abf6fa7e2a6d9a7bfb88796141b0f012e68c2db/dom/media/Benchmark.cpp#180 I rewrote the code as follows: > - mTrackDemuxer = > - mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0); > + if (mDemuxer->GetNumberTracks(TrackInfo::kVideoTrack)) { > + mTrackDemuxer = > + mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0); > + } else if (mDemuxer->GetNumberTracks(TrackInfo::kAudioTrack)) { > + mTrackDemuxer = > + mDemuxer->GetTrackDemuxer(TrackInfo::kAudioTrack, 0); > + } Does this look like the right approach? And does it make sense to support more than one audio/video track? I can attach a proper patch for review if this is the right way to go.
Component: Audio/Video → Audio/Video: Playback
Setting needinfo for :jya to confirm the approach in comment 0 or suggest an alternative that I can implement.
Flags: needinfo?(jyavenard)
that or following the current style. mTrackDemuxer = mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0); if (!mTrackDemuxer) { mTrackDemuxer = mDemuxer->GetTrackDemuxer(TrackInfo::kVideoTrack, 0); if (!mTrackDemuxer) { MainThreadShutdown(); return; } } the one you suggest looks better though
Flags: needinfo?(jyavenard)
Comment on attachment 8962686 [details] Bug 1446929 - Support audio files in media Benchmark class. https://reviewboard.mozilla.org/r/231556/#review237054
Attachment #8962686 - Flags: review?(jyavenard) → review+
Assignee: nobody → choller
Status: NEW → ASSIGNED
Pushed by choller@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fc9024c91420 Support audio files in media Benchmark class. r=jya
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: