diff options
author | Marco Nelissen <marcone@google.com> | 2014-12-10 20:12:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-12-10 20:12:22 +0000 |
commit | a04c05ab9c0cdca30952a687f9f5bd909c28b86a (patch) | |
tree | 646351cf8ca0e3c4410456e77939d0d433f8abbf | |
parent | 1914e7edb45114e9953982f21c50e754af5d1fe1 (diff) | |
parent | 69113e8ccc30fbdb8733ca2070bd3491b21e656d (diff) | |
download | frameworks_av-a04c05ab9c0cdca30952a687f9f5bd909c28b86a.zip frameworks_av-a04c05ab9c0cdca30952a687f9f5bd909c28b86a.tar.gz frameworks_av-a04c05ab9c0cdca30952a687f9f5bd909c28b86a.tar.bz2 |
Merge "Truncate file before recording into it."
-rw-r--r-- | media/libmediaplayerservice/StagefrightRecorder.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index cadd691..de25291 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -260,6 +260,9 @@ status_t StagefrightRecorder::setOutputFile(int fd, int64_t offset, int64_t leng return -EBADF; } + // start with a clean, empty file + ftruncate(fd, 0); + if (mOutputFd >= 0) { ::close(mOutputFd); } |