Closed Bug 1242465 Opened 8 years ago Closed 8 years ago

[Static Analysis][Logically dead code] In function SupportsMimeType from FFmpegDecoderModule.h

Categories

(Core :: Audio/Video: Playback, defect, P5)

defect

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox46 --- affected
firefox47 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1349784)

Attachments

(1 file)

The Static Analysis tool Coverity added that due to it's value, audioCodec = AV_CODEC_ID_NONE execution cannot reach the expression audioCodec inside this statement: 

>>   AVCodecID codec = audioCodec != AV_CODEC_ID_NONE ? audioCodec : videoCodec;

We can refactor this portion of the code in order to best suit our implementation based of #ifdef USING_MOZFFVPX
Component: Audio/Video → Audio/Video: Playback
Comment on attachment 8711657 [details]
MozReview Request: Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya

jya is a better reviewer for things ffmpeg related.
Attachment #8711657 - Flags: review?(cpearce) → review?(jyavenard)
This seems like a false positive to me. It is not dead code (or at least my definition of dead code). audioCodec is always NONE so we only test for video codec only.
Comment on attachment 8711657 [details]
MozReview Request: Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya

https://reviewboard.mozilla.org/r/32289/#review29105

::: dom/media/platforms/ffmpeg/FFmpegDecoderModule.h:71
(Diff revision 1)
> +

if we want to be that anal, then reorganise the structure so we only have a single conditional block based on MOZ_FFVPX by moving the search for the video codec above the block
Attachment #8711657 - Flags: review?(jyavenard)
Comment on attachment 8711657 [details]
MozReview Request: Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/32289/diff/1-2/
Attachment #8711657 - Attachment description: MozReview Request: Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?cpearce → MozReview Request: Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya
Attachment #8711657 - Flags: review?(jyavenard)
Comment on attachment 8711657 [details]
MozReview Request: Bug 1242465 - when defined USING_MOZFFVPX use by default videoCodec in FindAVCodec. r?jya

https://reviewboard.mozilla.org/r/32289/#review29257

Should add that this really was a false positive. Both gcc and clang optimise this code to remove all handling of audioCodec.
Attachment #8711657 - Flags: review?(jyavenard) → review+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/5d5ead7b7049
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: