Skip to content

Commit

Permalink
[video] Fix SimpleDecodingSource for video. JB#41180
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Branson committed Mar 9, 2018
1 parent 6bace35 commit 203c52c
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions droidmediacodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,21 +671,20 @@ DroidMediaCodec *droid_media_codec_create_encoder(DroidMediaCodecEncoderMetaData

bool droid_media_codec_start(DroidMediaCodec *codec)
{
if (codec->m_queue.get() != NULL) {
#if ANDROID_MAJOR < 7
if (codec->m_queue.get() != NULL) {
if (!codec->m_queue->connectListener()) {
ALOGE("Failed to connect buffer queue listener");
return false;
}
#endif

android::status_t err = native_window_api_connect(codec->m_window.get(),
NATIVE_WINDOW_API_MEDIA);
if (err != android::NO_ERROR) {
ALOGE("Failed to connect window");
return false;
}
}
#endif

int err = codec->m_codec->start();
if (err != android::OK) {
Expand Down Expand Up @@ -773,21 +772,21 @@ DroidMediaCodecLoopReturn droid_media_codec_loop(DroidMediaCodec *codec)
return DROID_MEDIA_CODEC_LOOP_ERROR;
}
}

if (err == -EWOULDBLOCK) {
ALOGI("retry reading again. error: 0x%x", -err);
return DROID_MEDIA_CODEC_LOOP_OK;
}

#if 0
if (err == -EWOULDBLOCK || err == -ETIMEDOUT) {
if (err == -EWOULDBLOCK
#if ANDROID_MAJOR >= 7
|| err == -ENODATA
#endif
) {
ALOGI("retry reading again. error: 0x%x", -err);
return DROID_MEDIA_CODEC_LOOP_OK;
}
#endif

if (err != android::OK) {
if (err == android::ERROR_END_OF_STREAM || err == -ENODATA) {
if (err == android::ERROR_END_OF_STREAM
#if ANDROID_MAJOR < 7
|| err == -ENODATA
#endif
) {
ALOGE("Got EOS");

if (codec->m_cb.signal_eos) {
Expand Down

0 comments on commit 203c52c

Please sign in to comment.