Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a7108232 authored by Mingming Yin's avatar Mingming Yin Committed by Ricardo Cerqueira
Browse files

audio: fix meta MIME type failure in MPEG4Writer

- MIME type info included in source->getFormat()
  is not updated properly because only temp
  variable is updated in AudioSource::getFormat().
  MIME type string contains garbage value and it
  results in invalid audio formats.
  MPEG4Writer returns ERROR_UNSUPPORTED and tunnel
  mode recording with 3gpp format fails
- Fix this issue by assigning return value of
  getFormat() to a local variable, and check the
  return value of findCString.

Change-Id: I242fa25a5d4f7b7e2c88fdd855208dcd42883b6c
parent a04bede9
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -441,7 +441,8 @@ status_t MPEG4Writer::addSource(const sp<MediaSource> &source) {


    // A track of type other than video or audio is not supported.
    // A track of type other than video or audio is not supported.
    const char *mime;
    const char *mime;
    source->getFormat()->findCString(kKeyMIMEType, &mime);
    sp<MetaData> meta = source->getFormat();
    CHECK(meta->findCString(kKeyMIMEType, &mime));
    bool isAudio = !strncasecmp(mime, "audio/", 6);
    bool isAudio = !strncasecmp(mime, "audio/", 6);
    bool isVideo = !strncasecmp(mime, "video/", 6);
    bool isVideo = !strncasecmp(mime, "video/", 6);
    if (!isAudio && !isVideo) {
    if (!isAudio && !isVideo) {