Add the logging for 'Container not supported' error

Dump the first 512 bytes of the buffer if container is unknown. This
can help us find out what the actual container is; and fix the
container detection bug if there is.

Closes #505.

Change-Id: I4a8fe5954d0419ef2ccbb9067ec2e9ffe1da417e
This commit is contained in:
KongQun Yang 2018-11-08 17:06:05 -08:00
parent 70dfced819
commit db3ed544f8
1 changed files with 10 additions and 2 deletions

View File

@ -199,9 +199,17 @@ Status Demuxer::InitializeParser() {
case CONTAINER_WEBM: case CONTAINER_WEBM:
parser_.reset(new WebMMediaParser()); parser_.reset(new WebMMediaParser());
break; break;
break; case CONTAINER_UNKNOWN: {
const int64_t kDumpSizeLimit = 512;
LOG(ERROR) << "Failed to detect the container type from the buffer: "
<< base::HexEncode(buffer_.get(),
std::min(bytes_read, kDumpSizeLimit));
return Status(error::INVALID_ARGUMENT,
"Failed to detect the container type.");
}
default: default:
NOTIMPLEMENTED(); NOTIMPLEMENTED() << "Container " << container_name_
<< " is not supported.";
return Status(error::UNIMPLEMENTED, "Container not supported."); return Status(error::UNIMPLEMENTED, "Container not supported.");
} }