Closed Bug 1411821 Opened 4 years ago Closed 4 years ago

Use BufferReader in mp3 parser

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: ayang, Assigned: ayang)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Assignee: nobody → ayang
No longer depends on: 1411815
Comment on attachment 8922163 [details]
Bug 1411821 - use BufferReader instead of ByteReader in MP3 parser.

https://reviewboard.mozilla.org/r/193174/#review198426

::: dom/media/mp3/MP3Demuxer.cpp:544
(Diff revision 1)
>      }
>  
> -    ByteReader reader(buffer, read);
> +    BufferReader reader(buffer, read);
>      uint32_t bytesToSkip = 0;
> -    foundFrame = mParser.Parse(&reader, &bytesToSkip);
> +    auto res = mParser.Parse(&reader, &bytesToSkip);
> +    foundFrame = res.isOk() ? res.unwrap() : false;

It's a shame the mozilla::Result doesn't have unwrap_or so this pattern could be |foundFrame = res.unwrap_or(false);|.
Attachment #8922163 - Flags: review?(kinetik) → review+
Pushed by ayang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/50e62206a4b0
use BufferReader instead of ByteReader in MP3 parser. r=kinetik
https://hg.mozilla.org/mozilla-central/rev/50e62206a4b0
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Depends on: 1500713
No longer depends on: 1500713
Regressions: 1500713
You need to log in before you can comment on or make changes to this bug.