Skip to content

Commit

Permalink
ALAC/alac_encoder.c : Add correct byte swapping for mChannelLayoutTag.
Browse files Browse the repository at this point in the history
Patch from Michael Pruett, author of libaudiofile.
  • Loading branch information
erikd committed Mar 6, 2013
1 parent ebda7e5 commit e11a0c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2013-03-07 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* src/ALAC/alac_encoder.c
Patch from Michael Pruett (author of libaudiofile) to add correct byte
swapping for the mChannelLayoutTag field.

2013-03-02 Erik de Castro Lopo <erikd AT mega-nerd DOT com>

* doc/bugs.html
Expand Down
4 changes: 2 additions & 2 deletions src/ALAC/alac_encoder.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2011 Apple Inc. All rights reserved.
* Copyright (C) 2012 Erik de Castro Lopo <erikd@mega-nerd.com>
* Copyright (C) 2012-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
Expand Down Expand Up @@ -1151,7 +1151,7 @@ alac_get_magic_cookie(ALAC_ENCODER *p, void * outCookie, uint32_t * ioSize )
GetConfig(p, &theConfig);
if (theConfig.numChannels > 2)
{
theChannelLayout.mChannelLayoutTag = ALACChannelLayoutTags[theConfig.numChannels - 1];
theChannelLayout.mChannelLayoutTag = Swap32NtoB(ALACChannelLayoutTags[theConfig.numChannels - 1]);
theCookieSize += (sizeof(ALACAudioChannelLayout) + kChannelAtomSize);
}
if (*ioSize >= theCookieSize)
Expand Down

0 comments on commit e11a0c1

Please sign in to comment.