diff options
Diffstat (limited to 'cmds/screenrecord')
-rw-r--r-- | cmds/screenrecord/screenrecord.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds/screenrecord/screenrecord.cpp b/cmds/screenrecord/screenrecord.cpp index c904b03..a5fbe16 100644 --- a/cmds/screenrecord/screenrecord.cpp +++ b/cmds/screenrecord/screenrecord.cpp @@ -143,6 +143,10 @@ static status_t prepareEncoder(float displayFps, sp<MediaCodec>* pCodec, looper->start(); ALOGV("Creating codec"); sp<MediaCodec> codec = MediaCodec::CreateByType(looper, "video/avc", true); + if (codec == NULL) { + fprintf(stderr, "ERROR: unable to create video/avc codec instance\n"); + return UNKNOWN_ERROR; + } err = codec->configure(format, NULL, NULL, MediaCodec::CONFIGURE_FLAG_ENCODE); if (err != NO_ERROR) { |