diff options
author | James Almer <jamrial@gmail.com> | 2017-10-03 20:35:17 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-10-03 20:52:44 -0300 |
commit | 5678b2a82074e4926ce0b73dc4e1190c8dfcd35d (patch) | |
tree | e333583259781d18fdb57d3d1bf754899ca69303 | |
parent | 9266cc54aa5c882c16d994ce1b0f6043ba9c2a87 (diff) | |
parent | 984736dd9e5b50987a5910e22495304e4a6d975c (diff) | |
download | ffmpeg-5678b2a82074e4926ce0b73dc4e1190c8dfcd35d.tar.gz |
Merge commit '984736dd9e5b50987a5910e22495304e4a6d975c'
* commit '984736dd9e5b50987a5910e22495304e4a6d975c':
lavc: make sure not to return EAGAIN from codecs
Merged-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/aacdec.c | 6 | ||||
-rw-r--r-- | libavcodec/qsv.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index f3656c056a..fe50871476 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -458,7 +458,7 @@ static int read_audio_mux_element(struct LATMContext *latmctx, } else if (!latmctx->aac_ctx.avctx->extradata) { av_log(latmctx->aac_ctx.avctx, AV_LOG_DEBUG, "no decoder config found\n"); - return AVERROR(EAGAIN); + return 1; } if (latmctx->audio_mux_version_A == 0) { int mux_slot_length_bytes = read_payload_length_info(latmctx, gb); @@ -495,8 +495,8 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out, if (muxlength > avpkt->size) return AVERROR_INVALIDDATA; - if ((err = read_audio_mux_element(latmctx, &gb)) < 0) - return err; + if ((err = read_audio_mux_element(latmctx, &gb))) + return (err < 0) ? err : avpkt->size; if (!latmctx->initialized) { if (!avctx->extradata) { diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c index b9e2cd990d..56ca9df262 100644 --- a/libavcodec/qsv.c +++ b/libavcodec/qsv.c @@ -94,15 +94,17 @@ static const struct { { MFX_ERR_LOCK_MEMORY, AVERROR(EIO), "failed to lock the memory block" }, { MFX_ERR_NOT_INITIALIZED, AVERROR_BUG, "not initialized" }, { MFX_ERR_NOT_FOUND, AVERROR(ENOSYS), "specified object was not found" }, - { MFX_ERR_MORE_DATA, AVERROR(EAGAIN), "expect more data at input" }, - { MFX_ERR_MORE_SURFACE, AVERROR(EAGAIN), "expect more surface at output" }, + /* the following 3 errors should always be handled explicitly, so those "mappings" + * are for completeness only */ + { MFX_ERR_MORE_DATA, AVERROR_UNKNOWN, "expect more data at input" }, + { MFX_ERR_MORE_SURFACE, AVERROR_UNKNOWN, "expect more surface at output" }, + { MFX_ERR_MORE_BITSTREAM, AVERROR_UNKNOWN, "expect more bitstream at output" }, { MFX_ERR_ABORTED, AVERROR_UNKNOWN, "operation aborted" }, { MFX_ERR_DEVICE_LOST, AVERROR(EIO), "device lost" }, { MFX_ERR_INCOMPATIBLE_VIDEO_PARAM, AVERROR(EINVAL), "incompatible video parameters" }, { MFX_ERR_INVALID_VIDEO_PARAM, AVERROR(EINVAL), "invalid video parameters" }, { MFX_ERR_UNDEFINED_BEHAVIOR, AVERROR_BUG, "undefined behavior" }, { MFX_ERR_DEVICE_FAILED, AVERROR(EIO), "device failed" }, - { MFX_ERR_MORE_BITSTREAM, AVERROR(EAGAIN), "expect more bitstream at output" }, { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio parameters" }, { MFX_ERR_INVALID_AUDIO_PARAM, AVERROR(EINVAL), "invalid audio parameters" }, |