Skip to content

Commit

Permalink
Add support for .cmf* extension in DefaultHlsExtractorFactory
Browse files Browse the repository at this point in the history
This makes extractor selection a bit more efficient for some CMAF files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=219795105
  • Loading branch information
AquilesCanta authored and ojw28 committed Nov 2, 2018
1 parent 32927bb commit 3479765
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public final class DefaultHlsExtractorFactory implements HlsExtractorFactory {
public static final String MP4_FILE_EXTENSION = ".mp4";
public static final String M4_FILE_EXTENSION_PREFIX = ".m4";
public static final String MP4_FILE_EXTENSION_PREFIX = ".mp4";
public static final String CMF_FILE_EXTENSION_PREFIX = ".cmf";
public static final String VTT_FILE_EXTENSION = ".vtt";
public static final String WEBVTT_FILE_EXTENSION = ".webvtt";

Expand Down Expand Up @@ -191,7 +192,8 @@ private Extractor createExtractorByFileExtension(
return new Mp3Extractor(/* flags= */ 0, /* forcedFirstSampleTimestampUs= */ 0);
} else if (lastPathSegment.endsWith(MP4_FILE_EXTENSION)
|| lastPathSegment.startsWith(M4_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 4)
|| lastPathSegment.startsWith(MP4_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 5)) {
|| lastPathSegment.startsWith(MP4_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 5)
|| lastPathSegment.startsWith(CMF_FILE_EXTENSION_PREFIX, lastPathSegment.length() - 5)) {
return new FragmentedMp4Extractor(
/* flags= */ 0,
timestampAdjuster,
Expand Down

0 comments on commit 3479765

Please sign in to comment.