summaryrefslogtreecommitdiffstats
path: root/cmds/stagefright/audioloop.cpp
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-12-08 13:59:51 -0800
committerMarco Nelissen <marcone@google.com>2014-12-10 00:10:40 +0000
commitc6ac859f5a82ea8642bc6351a45508a15f224f32 (patch)
treefcb36256d059f0f161f7dffade59588e806a1d13 /cmds/stagefright/audioloop.cpp
parenta1ded198ab2cceb07353a6dd42783e8c8dfdb03f (diff)
downloadframeworks_av-c6ac859f5a82ea8642bc6351a45508a15f224f32.zip
frameworks_av-c6ac859f5a82ea8642bc6351a45508a15f224f32.tar.gz
frameworks_av-c6ac859f5a82ea8642bc6351a45508a15f224f32.tar.bz2
Remove filename based writer constructors
MediaPlayerService can't open files (it needs an already opened file descriptor), so these were just wasting space. Change-Id: I323044a6c1814a7bff952ed71b5c7792df2abf03
Diffstat (limited to 'cmds/stagefright/audioloop.cpp')
-rw-r--r--cmds/stagefright/audioloop.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/cmds/stagefright/audioloop.cpp b/cmds/stagefright/audioloop.cpp
index 96073f1..7b0de24 100644
--- a/cmds/stagefright/audioloop.cpp
+++ b/cmds/stagefright/audioloop.cpp
@@ -14,6 +14,10 @@
* limitations under the License.
*/
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
#include <binder/ProcessState.h>
#include <media/mediarecorder.h>
#include <media/stagefright/foundation/ADebug.h>
@@ -109,7 +113,12 @@ int main(int argc, char* argv[])
if (fileOut != NULL) {
// target file specified, write encoded AMR output
- sp<AMRWriter> writer = new AMRWriter(fileOut);
+ int fd = open(fileOut, O_CREAT | O_LARGEFILE | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR);
+ if (fd < 0) {
+ return 1;
+ }
+ sp<AMRWriter> writer = new AMRWriter(fd);
+ close(fd);
writer->addSource(encoder);
writer->start();
sleep(duration);