I wanted to save some space, and ended up with a deadlock.
This change basically restores setDataSource(fd, offset, size) to the
way it was before I added the new setDataSource(DataSource) method,
instead of calling through to it.
Change-Id: Iacf4627c8745369fa84b467530189a9f64f8726b
}
status_t NuMediaExtractor::setDataSource(int fd, off64_t offset, off64_t size) {
+
Mutex::Autolock autoLock(mLock);
if (mImpl != NULL) {
sp<FileSource> fileSource = new FileSource(dup(fd), offset, size);
- return setDataSource(fileSource);
+ status_t err = fileSource->initCheck();
+ if (err != OK) {
+ return err;
+ }
+
+ mImpl = MediaExtractor::Create(fileSource);
+
+ if (mImpl == NULL) {
+ return ERROR_UNSUPPORTED;
+ }
+
+ mDataSource = fileSource;
+
+ updateDurationAndBitrate();
+
+ return OK;
}
status_t NuMediaExtractor::setDataSource(const sp<DataSource> &source) {