Author: bnickel
Date: 2007-06-12 23:06:22 -0400 (Tue, 12 Jun 2007)
New Revision: 79373
Modified:
trunk/taglib-sharp/ChangeLog
trunk/taglib-sharp/src/TagLib/Mpeg4/Box.cs
trunk/taglib-sharp/src/TagLib/Mpeg4/File.cs
trunk/taglib-sharp/src/TagLib/Riff/WaveFormatEx.cs
Log:
2007-06-12 Brian Nickel <[EMAIL PROTECTED]>
* src/TagLib/Mpeg4/File.cs: Fix support for writing files that don't
have UTDA tags. (Thanks to renzska for the bug report.)
* src/TagLib/Mpeg4/Box.cs: Fix support for clearing boxes. (Thanks to
maciej for the bug report.) Calculate padding size based on DataSize
rather than header.DataSize. Fixes problem where 4 bytes are added on
every save. (Discovered in bug report by lindea.)
* src/TagLib/Riff/WaveFormatEx.cs: Recognize WMA Lossless. (Thanks to
JustinC for the patch.)
* ALSO: Thanks to JustinC for reminding me to credit people for their
contributions. With the countless audio and video files in existence,
TagLib# would be far less complete and considerably buggier if not for
everyone's contributions. Thank you!
Modified: trunk/taglib-sharp/ChangeLog
===================================================================
--- trunk/taglib-sharp/ChangeLog 2007-06-13 02:32:35 UTC (rev 79372)
+++ trunk/taglib-sharp/ChangeLog 2007-06-13 03:06:22 UTC (rev 79373)
@@ -1,3 +1,21 @@
+2007-06-12 Brian Nickel <[EMAIL PROTECTED]>
+
+ * src/TagLib/Mpeg4/File.cs: Fix support for writing files that don't
+ have UTDA tags. (Thanks to renzska for the bug report.)
+
+ * src/TagLib/Mpeg4/Box.cs: Fix support for clearing boxes. (Thanks to
+ maciej for the bug report.) Calculate padding size based on DataSize
+ rather than header.DataSize. Fixes problem where 4 bytes are added on
+ every save. (Discovered in bug report by lindea.)
+
+ * src/TagLib/Riff/WaveFormatEx.cs: Recognize WMA Lossless. (Thanks to
+ JustinC for the patch.)
+
+ * ALSO: Thanks to JustinC for reminding me to credit people for their
+ contributions. With the countless audio and video files in existence,
+ TagLib# would be far less complete and considerably buggier if not for
+ everyone's contributions. Thank you!
+
2007-06-11 Brian Nickel <[EMAIL PROTECTED]>
* src/TagLib/Ogg/Paginator.cs: Fix save support in OGG. Thanks to
Modified: trunk/taglib-sharp/src/TagLib/Mpeg4/Box.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Mpeg4/Box.cs 2007-06-13 02:32:35 UTC (rev
79372)
+++ trunk/taglib-sharp/src/TagLib/Mpeg4/Box.cs 2007-06-13 03:06:22 UTC (rev
79373)
@@ -98,7 +98,7 @@
// If there was a free, don't take it away, and let meta be a special
case.
if (free_found || BoxType == Mpeg4.BoxType.Meta)
{
- long size_difference = header.DataSize - output.Count;
+ long size_difference = DataSize - output.Count;
// If we have room for free space, add it so we don't have to
resize the file.
if (header.DataSize != 0 && size_difference >= 8)
@@ -191,7 +191,7 @@
public void RemoveChild (ByteVector type)
{
if (Children != null && Children is ICollection<Box>)
- foreach (Box b in Children)
+ foreach (Box b in new List<Box> (Children))
if (b.BoxType == type)
(Children as ICollection<Box>).Remove (b);
}
Modified: trunk/taglib-sharp/src/TagLib/Mpeg4/File.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Mpeg4/File.cs 2007-06-13 02:32:35 UTC (rev
79372)
+++ trunk/taglib-sharp/src/TagLib/Mpeg4/File.cs 2007-06-13 03:06:22 UTC (rev
79373)
@@ -66,13 +66,13 @@
ByteVector tag_data = udta_box.Render ();
// If we don't have a "udta" box to overwrite...
- if (parser.UdtaTree.Length == 0 || parser.UdtaTree
[parser.UdtaTree.Length - 1].BoxType != BoxType.Udta)
+ if (parser.UdtaTree == null || parser.UdtaTree.Length == 0 ||
parser.UdtaTree [parser.UdtaTree.Length - 1].BoxType != BoxType.Udta)
{
// Stick the box at the end of the moov box.
BoxHeader moov_header = parser.MoovTree [parser.MoovTree.Length -
1];
size_change = tag_data.Count;
- write_position = 0;
- Insert (tag_data, moov_header.Position + moov_header.TotalBoxSize,
0);
+ write_position = moov_header.Position + moov_header.TotalBoxSize;
+ Insert (tag_data, write_position, 0);
// Overwrite the parent box sizes.
for (int i = parser.MoovTree.Length - 1; i >= 0; i --)
@@ -84,7 +84,7 @@
BoxHeader udta_header = parser.UdtaTree [parser.UdtaTree.Length -
1];
size_change = tag_data.Count - udta_header.TotalBoxSize;
write_position = udta_header.Position;
- Insert (tag_data, udta_header.Position, udta_header.TotalBoxSize);
+ Insert (tag_data, write_position, udta_header.TotalBoxSize);
// Overwrite the parent box sizes.
for (int i = parser.UdtaTree.Length - 2; i >= 0; i --)
Modified: trunk/taglib-sharp/src/TagLib/Riff/WaveFormatEx.cs
===================================================================
--- trunk/taglib-sharp/src/TagLib/Riff/WaveFormatEx.cs 2007-06-13 02:32:35 UTC
(rev 79372)
+++ trunk/taglib-sharp/src/TagLib/Riff/WaveFormatEx.cs 2007-06-13 03:06:22 UTC
(rev 79373)
@@ -172,6 +172,7 @@
case 0x0160: return "Microsoft WMA1 Audio";
case 0x0161: return "Microsoft WMA2 Audio";
case 0x0162: return "Microsoft Multichannel WMA Audio";
+ case 0x0163: return "Microsoft Lossless WMA Audio";
/*
case 0x0170 WAVE_FORMAT_UNISYS_NAP_ADPCM Unisys
Corporation Not specified
case 0x0171 WAVE_FORMAT_UNISYS_NAP_ULAW Unisys
Corporation Not specified
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches