From 8f5a66b486358aa4349f050d016b88ff0a67621f Mon Sep 17 00:00:00 2001 From: Moonchild Date: Sun, 29 Dec 2024 13:38:10 +0100 Subject: [PATCH] Issue #2673 - Part 3: Fix coding style. --- .../mediasniffer/nsMediaSniffer.cpp | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/toolkit/components/mediasniffer/nsMediaSniffer.cpp b/toolkit/components/mediasniffer/nsMediaSniffer.cpp index dcf9e56e0b..e9dc5dbd5d 100644 --- a/toolkit/components/mediasniffer/nsMediaSniffer.cpp +++ b/toolkit/components/mediasniffer/nsMediaSniffer.cpp @@ -3,17 +3,17 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "nsMediaSniffer.h" -#include "nsIHttpChannel.h" -#include "nsString.h" -#include "nsMimeTypes.h" +#include "FlacDemuxer.h" #include "mozilla/ArrayUtils.h" #include "mozilla/ModuleUtils.h" #include "mp3sniff.h" #include "nestegg/nestegg.h" -#include "FlacDemuxer.h" - #include "nsIClassInfoImpl.h" +#include "nsIHttpChannel.h" +#include "nsMediaSniffer.h" +#include "nsMimeTypes.h" +#include "nsString.h" + #include // The minimum number of bytes that are needed to attempt to sniff an mp4 file. @@ -50,8 +50,8 @@ nsMediaSnifferEntry sFtypEntries[] = { PATTERN_ENTRY("\xFF\xFF\xFF\xFF", "mmp4", VIDEO_MP4), }; -static bool MatchesBrands(const uint8_t aData[4], nsACString& aSniffedType) -{ +static bool +MatchesBrands(const uint8_t aData[4], nsACString& aSniffedType) { for (size_t i = 0; i < mozilla::ArrayLength(sFtypEntries); ++i) { const auto& currentEntry = sFtypEntries[i]; bool matched = true; @@ -74,8 +74,8 @@ static bool MatchesBrands(const uint8_t aData[4], nsACString& aSniffedType) // This function implements sniffing algorithm for MP4 family file types, // including MP4 (described at http://mimesniff.spec.whatwg.org/#signature-for-mp4), // M4A (Apple iTunes audio), and 3GPP. -static bool MatchesMP4(const uint8_t* aData, const uint32_t aLength, nsACString& aSniffedType) -{ +static bool +MatchesMP4(const uint8_t* aData, const uint32_t aLength, nsACString& aSniffedType) { if (aLength <= MP4_MIN_BYTES_COUNT) { return false; } @@ -108,20 +108,20 @@ static bool MatchesMP4(const uint8_t* aData, const uint32_t aLength, nsACString& return false; } -static bool MatchesWebM(const uint8_t* aData, const uint32_t aLength) -{ +static bool +MatchesWebM(const uint8_t* aData, const uint32_t aLength) { return nestegg_sniff((uint8_t*)aData, aLength) ? true : false; } // This function implements mp3 sniffing based on parsing // packet headers and looking for expected boundaries. -static bool MatchesMP3(const uint8_t* aData, const uint32_t aLength) -{ +static bool +MatchesMP3(const uint8_t* aData, const uint32_t aLength) { return mp3_sniff(aData, (long)aLength); } -static bool MatchesFLAC(const uint8_t* aData, const uint32_t aLength) -{ +static bool +MatchesFLAC(const uint8_t* aData, const uint32_t aLength) { return mozilla::FlacDemuxer::FlacSniffer(aData, aLength); } @@ -129,8 +129,7 @@ NS_IMETHODIMP nsMediaSniffer::GetMIMETypeFromContent(nsIRequest* aRequest, const uint8_t* aData, const uint32_t aLength, - nsACString& aSniffedType) -{ + nsACString& aSniffedType) { nsCOMPtr channel = do_QueryInterface(aRequest); if (channel) { nsLoadFlags loadFlags = 0;