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;
import java.util.List;
import java.util.UUID;
/**
* Extracts data from the FMP4 container format.
*/
public final class FragmentedMp4Extractor implements Extractor {
/** Extracts data from the FMP4 container format. */
public class FragmentedMp4Extractor implements Extractor {
/** Factory for {@link FragmentedMp4Extractor} instances. */
public static final ExtractorsFactory FACTORY =
......@@ -486,8 +484,15 @@ public final class FragmentedMp4Extractor implements Extractor {
for (int i = 0; i < moovContainerChildrenSize; i++) {
Atom.ContainerAtom atom = moov.containerChildren.get(i);
if (atom.type == Atom.TYPE_trak) {
Track track = AtomParsers.parseTrak(atom, moov.getLeafAtomOfType(Atom.TYPE_mvhd), duration,
drmInitData, (flags & FLAG_WORKAROUND_IGNORE_EDIT_LISTS) != 0, false);
Track track =
modifyTrack(
AtomParsers.parseTrak(
atom,
moov.getLeafAtomOfType(Atom.TYPE_mvhd),
duration,
drmInitData,
(flags & FLAG_WORKAROUND_IGNORE_EDIT_LISTS) != 0,
false));
if (track != null) {
tracks.put(track.id, track);
}
......@@ -517,6 +522,11 @@ public final class FragmentedMp4Extractor implements Extractor {
}
}
@Nullable
protected Track modifyTrack(@Nullable Track track) {
return track;
}
private DefaultSampleValues getDefaultSampleValues(
SparseArray<DefaultSampleValues> defaultSampleValuesArray, int trackId) {
if (defaultSampleValuesArray.size() == 1) {
......
......@@ -128,4 +128,18 @@ public final class Track {
: 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