diff mbox

[FFmpeg-devel] avcodec/nvenc: use AVERROR_BUFFER_TOO_SMALL instead of ENOBUFS

Message ID 20160924183153.6000-1-jamrial@gmail.com
State Accepted
Commit dc48248ea8e6f7e3ab0d4e932046395c061ce602
Headers show

Commit Message

James Almer Sept. 24, 2016, 6:31 p.m. UTC
Should fix compilation with mingw32.

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavcodec/nvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Timo Rothenpieler Sept. 24, 2016, 6:41 p.m. UTC | #1
On 9/24/2016 8:31 PM, James Almer wrote:
> Should fix compilation with mingw32.
> 
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavcodec/nvenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
> index e3edd74..fc5253a 100644
> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -114,7 +114,7 @@ static const struct {
>      { NV_ENC_ERR_ENCODER_NOT_INITIALIZED,  AVERROR(EINVAL),  "encoder not initialized"  },
>      { NV_ENC_ERR_UNSUPPORTED_PARAM,        AVERROR(ENOSYS),  "unsupported param"        },
>      { NV_ENC_ERR_LOCK_BUSY,                AVERROR(EAGAIN),  "lock busy"                },
> -    { NV_ENC_ERR_NOT_ENOUGH_BUFFER,        AVERROR(ENOBUFS), "not enough buffer"        },
> +    { NV_ENC_ERR_NOT_ENOUGH_BUFFER,        AVERROR_BUFFER_TOO_SMALL, "not enough buffer"},
>      { NV_ENC_ERR_INVALID_VERSION,          AVERROR(EINVAL),  "invalid version"          },
>      { NV_ENC_ERR_MAP_FAILED,               AVERROR(EIO),     "map failed"               },
>      { NV_ENC_ERR_NEED_MORE_INPUT,          AVERROR(EAGAIN),  "need more input"          },

forgot about that one. LGTM
James Almer Sept. 24, 2016, 7:47 p.m. UTC | #2
On 9/24/2016 3:41 PM, Timo Rothenpieler wrote:
> On 9/24/2016 8:31 PM, James Almer wrote:
>> Should fix compilation with mingw32.
>>
>> Signed-off-by: James Almer <jamrial@gmail.com>
>> ---
>>  libavcodec/nvenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
>> index e3edd74..fc5253a 100644
>> --- a/libavcodec/nvenc.c
>> +++ b/libavcodec/nvenc.c
>> @@ -114,7 +114,7 @@ static const struct {
>>      { NV_ENC_ERR_ENCODER_NOT_INITIALIZED,  AVERROR(EINVAL),  "encoder not initialized"  },
>>      { NV_ENC_ERR_UNSUPPORTED_PARAM,        AVERROR(ENOSYS),  "unsupported param"        },
>>      { NV_ENC_ERR_LOCK_BUSY,                AVERROR(EAGAIN),  "lock busy"                },
>> -    { NV_ENC_ERR_NOT_ENOUGH_BUFFER,        AVERROR(ENOBUFS), "not enough buffer"        },
>> +    { NV_ENC_ERR_NOT_ENOUGH_BUFFER,        AVERROR_BUFFER_TOO_SMALL, "not enough buffer"},
>>      { NV_ENC_ERR_INVALID_VERSION,          AVERROR(EINVAL),  "invalid version"          },
>>      { NV_ENC_ERR_MAP_FAILED,               AVERROR(EIO),     "map failed"               },
>>      { NV_ENC_ERR_NEED_MORE_INPUT,          AVERROR(EAGAIN),  "need more input"          },
> 
> forgot about that one. LGTM

Applied, thanks.
diff mbox

Patch

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index e3edd74..fc5253a 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -114,7 +114,7 @@  static const struct {
     { NV_ENC_ERR_ENCODER_NOT_INITIALIZED,  AVERROR(EINVAL),  "encoder not initialized"  },
     { NV_ENC_ERR_UNSUPPORTED_PARAM,        AVERROR(ENOSYS),  "unsupported param"        },
     { NV_ENC_ERR_LOCK_BUSY,                AVERROR(EAGAIN),  "lock busy"                },
-    { NV_ENC_ERR_NOT_ENOUGH_BUFFER,        AVERROR(ENOBUFS), "not enough buffer"        },
+    { NV_ENC_ERR_NOT_ENOUGH_BUFFER,        AVERROR_BUFFER_TOO_SMALL, "not enough buffer"},
     { NV_ENC_ERR_INVALID_VERSION,          AVERROR(EINVAL),  "invalid version"          },
     { NV_ENC_ERR_MAP_FAILED,               AVERROR(EIO),     "map failed"               },
     { NV_ENC_ERR_NEED_MORE_INPUT,          AVERROR(EAGAIN),  "need more input"          },