Support for amr-wb tracks in MPEG4Extractor.
diff --git a/media/libstagefright/MPEG4Extractor.cpp b/media/libstagefright/MPEG4Extractor.cpp
index 894d46c..433fb18 100644
--- a/media/libstagefright/MPEG4Extractor.cpp
+++ b/media/libstagefright/MPEG4Extractor.cpp
@@ -124,6 +124,9 @@
case FOURCC('s', 'a', 'm', 'r'):
return "audio/3gpp";
+ case FOURCC('s', 'a', 'w', 'b'):
+ return "audio/amr-wb";
+
case FOURCC('m', 'p', '4', 'v'):
return "video/mp4v-es";
@@ -189,6 +192,10 @@
--index;
}
+ if (track == NULL) {
+ return NULL;
+ }
+
return track->meta;
}
@@ -472,6 +479,7 @@
case FOURCC('m', 'p', '4', 'a'):
case FOURCC('s', 'a', 'm', 'r'):
+ case FOURCC('s', 'a', 'w', 'b'):
{
if (mHandlerType != FOURCC('s', 'o', 'u', 'n')) {
return ERROR_MALFORMED;
@@ -491,7 +499,8 @@
uint16_t data_ref_index = U16_AT(&buffer[6]);
uint16_t num_channels = U16_AT(&buffer[16]);
- if (!strcasecmp("audio/3gpp", FourCC2MIME(chunk_type))) {
+ if (!strcasecmp("audio/3gpp", FourCC2MIME(chunk_type))
+ || !strcasecmp("audio/amr-wb", FourCC2MIME(chunk_type))) {
// AMR audio is always mono.
num_channels = 1;
}
@@ -705,6 +714,10 @@
--index;
}
+ if (track == NULL) {
+ return NULL;
+ }
+
return new MPEG4Source(
track->meta, mDataSource, track->sampleTable);
}