Prior to this commit, if StageFright picks mimeType X with any
confidence <= .8 then it uses the StageFright extractors and otherwise
(if ffmpeg recognizes the file format) then it will use the ffmpeg
extractors.
This commit changes the logic to prefer the StageFright extractors
(keeping the behaviour closer to aosp and less dependent on ffmpeg's
implementation) whenever both agree on the same mime type.
Change-Id: I98b1b3c3e94756923106911783104ca42e916aed
ALOGV("sniff through BetterSniffFFMPEG success");
}
+ if (mimeType != NULL && container != NULL && *mimeType == container) {
+ ALOGD("SniffFFMPEG sniffed the same thing as StageFright, use their extractor instead");
+ goto fail;
+ }
+
if (container == NULL) {
ALOGD("SniffFFMPEG failed to sniff this source");
- (*meta)->clear();
- *meta = NULL;
- return false;
+ goto fail;
}
ALOGD("ffmpeg detected media content as '%s' with confidence %.2f",
}
return true;
+
+fail:
+ (*meta)->clear();
+ *meta = NULL;
+ return false;
}
MediaExtractor *CreateFFMPEGExtractor(const sp<DataSource> &source, const char *mime, const sp<AMessage> &meta) {