Commit c096e156 by mdoucleff Committed by Oliver Woodman

Interpret single-item audio stream edit lists as audio padding specification. …

Interpret single-item audio stream edit lists as audio padding specification.  Use the information to strip out padding from decoded audio streams.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221865861
parent 9dd814fc
...@@ -53,10 +53,8 @@ import java.util.Collections; ...@@ -53,10 +53,8 @@ import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /** Extracts data from the FMP4 container format. */
* Extracts data from the FMP4 container format. public class FragmentedMp4Extractor implements Extractor {
*/
public final class FragmentedMp4Extractor implements Extractor {
/** Factory for {@link FragmentedMp4Extractor} instances. */ /** Factory for {@link FragmentedMp4Extractor} instances. */
public static final ExtractorsFactory FACTORY = public static final ExtractorsFactory FACTORY =
...@@ -486,8 +484,15 @@ public final class FragmentedMp4Extractor implements Extractor { ...@@ -486,8 +484,15 @@ public final class FragmentedMp4Extractor implements Extractor {
for (int i = 0; i < moovContainerChildrenSize; i++) { for (int i = 0; i < moovContainerChildrenSize; i++) {
Atom.ContainerAtom atom = moov.containerChildren.get(i); Atom.ContainerAtom atom = moov.containerChildren.get(i);
if (atom.type == Atom.TYPE_trak) { if (atom.type == Atom.TYPE_trak) {
Track track = AtomParsers.parseTrak(atom, moov.getLeafAtomOfType(Atom.TYPE_mvhd), duration, Track track =
drmInitData, (flags & FLAG_WORKAROUND_IGNORE_EDIT_LISTS) != 0, false); modifyTrack(
AtomParsers.parseTrak(
atom,
moov.getLeafAtomOfType(Atom.TYPE_mvhd),
duration,
drmInitData,
(flags & FLAG_WORKAROUND_IGNORE_EDIT_LISTS) != 0,
false));
if (track != null) { if (track != null) {
tracks.put(track.id, track); tracks.put(track.id, track);
} }
...@@ -517,6 +522,11 @@ public final class FragmentedMp4Extractor implements Extractor { ...@@ -517,6 +522,11 @@ public final class FragmentedMp4Extractor implements Extractor {
} }
} }
@Nullable
protected Track modifyTrack(@Nullable Track track) {
return track;
}
private DefaultSampleValues getDefaultSampleValues( private DefaultSampleValues getDefaultSampleValues(
SparseArray<DefaultSampleValues> defaultSampleValuesArray, int trackId) { SparseArray<DefaultSampleValues> defaultSampleValuesArray, int trackId) {
if (defaultSampleValuesArray.size() == 1) { if (defaultSampleValuesArray.size() == 1) {
......
...@@ -128,4 +128,18 @@ public final class Track { ...@@ -128,4 +128,18 @@ public final class Track {
: sampleDescriptionEncryptionBoxes[sampleDescriptionIndex]; : sampleDescriptionEncryptionBoxes[sampleDescriptionIndex];
} }
public Track copyWithFormat(Format format) {
return new Track(
id,
type,
timescale,
movieTimescale,
durationUs,
format,
sampleTransformation,
sampleDescriptionEncryptionBoxes,
nalUnitLengthFieldLength,
editListDurations,
editListMediaTimes);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment