Merge commit 'd533ca61fa1e6a456f93a790cdb9b4eb5893a5a7' into eclair-mr2-plus-aosp * commit 'd533ca61fa1e6a456f93a790cdb9b4eb5893a5a7': Fix for random audio output failures, properly dup() the file descriptor in IMediaPlayer::setDataSource to assume ownership as the caller will otherwise close it.
This commit is contained in:
@ -40,11 +40,13 @@ status_t StagefrightPlayer::setDataSource(const char *url) {
|
||||
return err;
|
||||
}
|
||||
|
||||
// Warning: The filedescriptor passed into this method will only be valid until
|
||||
// the method returns, if you want to keep it, dup it!
|
||||
status_t StagefrightPlayer::setDataSource(int fd, int64_t offset, int64_t length) {
|
||||
LOGV("setDataSource(%d, %lld, %lld)", fd, offset, length);
|
||||
|
||||
reset();
|
||||
mPlayer = new MediaPlayerImpl(fd, offset, length);
|
||||
mPlayer = new MediaPlayerImpl(dup(fd), offset, length);
|
||||
|
||||
status_t err = mPlayer->initCheck();
|
||||
if (err != OK) {
|
||||
|
Reference in New Issue
Block a user