mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Issue #2673 - Part 3: Fix coding style.
This commit is contained in:
parent
e25b285ca7
commit
8f5a66b486
1 changed files with 17 additions and 18 deletions
|
|
@ -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 <algorithm>
|
||||
|
||||
// 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<nsIChannel> channel = do_QueryInterface(aRequest);
|
||||
if (channel) {
|
||||
nsLoadFlags loadFlags = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue