Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#JAUDIOTAGGER-387:Not writing new tag correctly when file has no tag …
…but does has free top header git-svn-id: https://svn.java.net/svn/jaudiotagger~svn/trunk@998 922cec90-98bc-ecba-b0a9-867c771b4a74
- Loading branch information
paultaylor
committed
Sep 22, 2011
1 parent
916ed09
commit cd21637
Showing
5 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package org.jaudiotagger.issues; | ||
|
||
import org.jaudiotagger.AbstractTestCase; | ||
import org.jaudiotagger.audio.AudioFile; | ||
import org.jaudiotagger.audio.AudioFileIO; | ||
import org.jaudiotagger.audio.mp4.Mp4AtomTree; | ||
|
||
import java.io.File; | ||
import java.io.RandomAccessFile; | ||
|
||
/** | ||
* Test writing mp4 | ||
*/ | ||
public class Issue387Test extends AbstractTestCase | ||
{ | ||
public void testIssue() throws Exception | ||
{ | ||
Exception caught = null; | ||
try | ||
{ | ||
File orig = new File("testdata", "test100.mp4"); | ||
if (!orig.isFile()) | ||
{ | ||
System.err.println("Unable to test file - not available"); | ||
return; | ||
} | ||
|
||
File testFile = AbstractTestCase.copyAudioToTmp("test100.mp4"); | ||
AudioFile af = AudioFileIO.read(testFile); | ||
System.out.println(af.getAudioHeader()); | ||
af.getTagOrCreateAndSetDefault(); | ||
af.commit(); | ||
|
||
Mp4AtomTree atomTree = new Mp4AtomTree(new RandomAccessFile(testFile, "r")); | ||
atomTree.printAtomTree(); | ||
|
||
} | ||
catch(Exception e) | ||
{ | ||
caught=e; | ||
e.printStackTrace(); | ||
} | ||
assertNull(caught); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters