diff options
author | Andy McFadden <fadden@android.com> | 2013-11-19 21:42:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-11-19 21:42:29 +0000 |
commit | 7ae751960d8b31e6e301c18122d1146da8fe5983 (patch) | |
tree | d6dfa7c80957155c1bd347a05bfb4a470dda3802 /cmds/screenrecord/screenrecord.cpp | |
parent | b50df220ae76c7bb6e78b096ece06b2609cf4ffe (diff) | |
parent | 7a66622c2c9250ce4ad0091195331ce4cb91a63d (diff) | |
download | frameworks_av-7ae751960d8b31e6e301c18122d1146da8fe5983.zip frameworks_av-7ae751960d8b31e6e301c18122d1146da8fe5983.tar.gz frameworks_av-7ae751960d8b31e6e301c18122d1146da8fe5983.tar.bz2 |
Merge "screenrecord fixes"
Diffstat (limited to 'cmds/screenrecord/screenrecord.cpp')
-rw-r--r-- | cmds/screenrecord/screenrecord.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmds/screenrecord/screenrecord.cpp b/cmds/screenrecord/screenrecord.cpp index b13333c..a6652f4 100644 --- a/cmds/screenrecord/screenrecord.cpp +++ b/cmds/screenrecord/screenrecord.cpp @@ -45,6 +45,7 @@ #include <signal.h> #include <getopt.h> #include <sys/wait.h> +#include <assert.h> #include "screenrecord.h" #include "Overlay.h" @@ -532,9 +533,10 @@ static status_t recordScreen(const char* fileName) { // Configure optional overlay. sp<IGraphicBufferProducer> bufferProducer; - sp<Overlay> overlay = new Overlay(); + sp<Overlay> overlay; if (gWantFrameTime) { // Send virtual display frames to an external texture. + overlay = new Overlay(); err = overlay->start(encoderInputSurface, &bufferProducer); if (err != NO_ERROR) { encoder->release(); @@ -578,7 +580,9 @@ static status_t recordScreen(const char* fileName) { // Shut everything down, starting with the producer side. encoderInputSurface = NULL; SurfaceComposerClient::destroyDisplay(dpy); - overlay->stop(); + if (overlay != NULL) { + overlay->stop(); + } encoder->stop(); // If we don't stop muxer explicitly, i.e. let the destructor run, // it may hang (b/11050628). |