~ubuntu-branches/ubuntu/utopic/libjaudiotagger-java/utopic-proposed

« back to all changes in this revision

Viewing changes to org/jaudiotagger/audio/mp4/atom/Mp4DrmsBox.java

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath, Damien Raude-Morvan, Varun Hiremath
  • Date: 2009-04-01 19:17:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090401191756-bygniim270guy7o1
Tags: 1.0.9-1
[ Damien Raude-Morvan ]
* New upstream release
* debian/watch: Use java.net repository (which contains new releases!)
* debian/control:
  - Build-Depends on default-jdk-builddep
  - Bump Standards-Version to 3.8.1 (no changes needed)
  - Change section to "java"
* debian/rules: use default-java as JAVA_HOME
* debina/orig-tar.{sh|excludes}: strip audio and others binary files from ZIP
* debian/build.xml:
  - compile with "nowarn" to keep build log readable
  - exclude LogFormatter from build (use com.sun classes)
* debian/ant.properties: new source directory is "src" in orig.tar.gz
* Add myself as Uploaders

[ Varun Hiremath ]
* Accept changes made by Damien Raude-Morvan (Closes: #522130)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package org.jaudiotagger.audio.mp4.atom;
2
 
 
3
 
import org.jaudiotagger.audio.exceptions.CannotReadException;
4
 
import org.jaudiotagger.audio.generic.Utils;
5
 
 
6
 
import java.nio.ByteBuffer;
7
 
 
8
 
/**
9
 
 * DrmsBox Replaces mp4a box on drm files
10
 
 *
11
 
 * Need to skip over data in order to find esds atom
12
 
 *
13
 
 * Specification not known, so just look for byte by byte 'esds' and then step back four bytes for size
14
 
 */
15
 
public class Mp4DrmsBox extends AbstractMp4Box
16
 
{
17
 
    /**
18
 
     *
19
 
     * @param header header info
20
 
     * @param dataBuffer data of box (doesnt include header data)
21
 
     */
22
 
    public Mp4DrmsBox(Mp4BoxHeader header, ByteBuffer dataBuffer)
23
 
    {
24
 
        this.header  = header;
25
 
        this.dataBuffer = dataBuffer;
26
 
    }
27
 
 
28
 
    /**
29
 
     * Process direct data
30
 
     *
31
 
     * @throws CannotReadException
32
 
     */
33
 
    public void processData() throws CannotReadException
34
 
    {
35
 
        while(dataBuffer.hasRemaining())
36
 
        {
37
 
            byte next = dataBuffer.get();
38
 
            if(next!=(byte)'e')
39
 
            {
40
 
                continue;
41
 
            }
42
 
 
43
 
            //Have we found esds identifier, if so adjust buffer to start of edds atom
44
 
            ByteBuffer tempBuffer = dataBuffer.slice();
45
 
            if(
46
 
                    (tempBuffer.get()==(byte)'s')&
47
 
                    (tempBuffer.get()==(byte)'d')&
48
 
                    (tempBuffer.get()==(byte)'s')
49
 
            )
50
 
            {
51
 
                dataBuffer.position(dataBuffer.position() - 1 - Mp4BoxHeader.OFFSET_LENGTH);
52
 
                return;
53
 
            }
54
 
        }
55
 
    }
56
 
}