Package com.google.android.exoplayer2.extractor

## Class GaplessInfoHolder

- java.lang.Object
- - com.google.android.exoplayer2.extractor.GaplessInfoHolder

-     public final class GaplessInfoHolder
      extends Object

  Holder for gapless playback information.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `encoderDelay` | The number of samples to trim from the start of the decoded audio stream, or `Format.NO_VALUE` if not set.
    `int` | `encoderPadding` | The number of samples to trim from the end of the decoded audio stream, or `Format.NO_VALUE` if not set.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GaplessInfoHolder()` | Creates a new holder for gapless playback information.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `hasGaplessInfo()` | Returns whether `encoderDelay` and `encoderPadding` have been set.
    `boolean` | `setFromMetadata​(Metadata metadata)` | Populates the holder with data parsed from ID3 `Metadata`.
    `boolean` | `setFromXingHeaderValue​(int value)` | Populates the holder with data from an MP3 Xing header, if valid and non-zero.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### encoderDelay

          public int encoderDelay

      The number of samples to trim from the start of the decoded audio stream, or `Format.NO_VALUE` if not set.

    - #### encoderPadding

          public int encoderPadding

      The number of samples to trim from the end of the decoded audio stream, or `Format.NO_VALUE` if not set.

  - ### Constructor Detail

    - #### GaplessInfoHolder

          public GaplessInfoHolder()

      Creates a new holder for gapless playback information.

  - ### Method Detail

    - #### setFromXingHeaderValue

          public boolean setFromXingHeaderValue​(int value)

      Populates the holder with data from an MP3 Xing header, if valid and non-zero.
      Parameters:
        `value` - The 24-bit value to decode.
      Returns:
        Whether the holder was populated.

    - #### setFromMetadata

          public boolean setFromMetadata​(Metadata metadata)

      Populates the holder with data parsed from ID3 `Metadata`.
      Parameters:
        `metadata` - The metadata from which to parse the gapless information.
      Returns:
        Whether the holder was populated.

    - #### hasGaplessInfo

          public boolean hasGaplessInfo()

      Returns whether `encoderDelay` and `encoderPadding` have been set.