Skip to content

Commit b8066fd

Browse files
committed
Cleanup
1 parent 69e609a commit b8066fd

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

ATL/AudioData/IO/MP4.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1756,13 +1756,9 @@ protected override void preprocessWrite(TagData dataToWrite)
17561756
}
17571757

17581758
// Chapter picture-related QA checks specific to MP4/M4A
1759-
if (dataToWrite.Chapters != null)
1759+
if (dataToWrite.Chapters != null && anyWithPicture(dataToWrite.Chapters) && dataToWrite.Chapters[0].StartTime > 0)
17601760
{
1761-
if (anyWithPicture(dataToWrite.Chapters))
1762-
{
1763-
if (dataToWrite.Chapters[0].StartTime > 0)
1764-
LogDelegator.GetLogDelegate()(Log.LV_WARNING, "First chapter start time is > 0:00 - that might cause chapter picture display issues on some players such as VLC.");
1765-
}
1761+
LogDelegator.GetLogDelegate()(Log.LV_WARNING, "First chapter start time is > 0:00 - that might cause chapter picture display issues on some players such as VLC.");
17661762
}
17671763
}
17681764

ATL/AudioData/Utils/XmlArray.cs

+7-6
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public int ToStream(Stream s, MetaDataHolder meta)
212212
// Namespaces explicitly attached to current element
213213
ISet<string> namespacesToAnchor = null;
214214
namespaceAnchors.TryGetValue(node.FullName, out namespacesToAnchor);
215-
if (namespacesToAnchor != null && namespacesToAnchor.Any(e => e.Equals("")))
215+
if (namespacesToAnchor != null && namespacesToAnchor.Any(e => string.IsNullOrEmpty(e)))
216216
{
217217
namespacesToAnchor.Clear();
218218
namespacesToAnchor.UnionWith(usedNamespaces);
@@ -229,7 +229,7 @@ public int ToStream(Stream s, MetaDataHolder meta)
229229
if (null == namespacesToAnchor || !namespacesToAnchor.Contains(ns))
230230
{
231231
// Not attached to any element => Attached to root
232-
var isAnchored = namespaceAnchors.Values.Any(s => s.Any(v => v.Equals("") || v.Equals(ns, StringComparison.OrdinalIgnoreCase)));
232+
var isAnchored = namespaceAnchors.Values.Any(s => s.Any(v => string.IsNullOrEmpty(v) || v.Equals(ns, StringComparison.OrdinalIgnoreCase)));
233233
if (isAnchored) continue;
234234
}
235235

@@ -281,7 +281,7 @@ public int ToStream(Stream s, MetaDataHolder meta)
281281

282282
// Namespaces explicitly attached to current element
283283
namespaceAnchors.TryGetValue(node.FullName, out namespacesToAnchor);
284-
if (namespacesToAnchor != null && namespacesToAnchor.Any(e => e.Equals("")))
284+
if (namespacesToAnchor != null && namespacesToAnchor.Any(e => string.IsNullOrEmpty(e)))
285285
{
286286
namespacesToAnchor.Clear();
287287
namespacesToAnchor.UnionWith(usedNamespaces);
@@ -293,9 +293,10 @@ public int ToStream(Stream s, MetaDataHolder meta)
293293

294294
// Attach anchored namespaces
295295
if (namespacesToAnchor != null)
296-
foreach (var ns in namespacesToAnchor)
297-
if (namespaces.ContainsKey(ns))
298-
writer.WriteAttributeString(ns, "http://www.w3.org/2000/xmlns/", namespaces[ns]);
296+
foreach (var ns in namespacesToAnchor.Where(ns => namespaces.ContainsKey(ns)))
297+
{
298+
writer.WriteAttributeString(ns, "http://www.w3.org/2000/xmlns/", namespaces[ns]);
299+
}
299300
}
300301

301302
// Write the last node (=leaf) as a proper value if it does not belong to structural attributes

0 commit comments

Comments
 (0)