cnuernber/avclj

AVERROR_EAGAIN is -35 on Mac OSX, not -11

Closed this issue · 2 comments

The example test avclj-test/encode-demo was failing for me with:

Exception calling avcodec: (-35) - "Resource temporarily unavailable"

After some googling, I found out that AVERROR(EAGAIN) has a different value on mac osx. I compiled and ran averr.cpp and every error code is the same except for AVERROR(EAGAIN).

Not sure what the best approach to fix is. I would be happy to submit or test a patch if you have a preferred approach.

Here's the full printout from averr.cpp:

{
"AVERROR_BSF_NOT_FOUND" -1179861752
"AVERROR_BUG" -558323010
"AVERROR_BUFFER_TOO_SMALL" -1397118274
"AVERROR_DECODER_NOT_FOUND" -1128613112
"AVERROR_DEMUXER_NOT_FOUND" -1296385272
"AVERROR_ENCODER_NOT_FOUND" -1129203192
"AVERROR_EOF" -541478725
"AVERROR_EXIT" -1414092869
"AVERROR_EXTERNAL" -542398533
"AVERROR_FILTER_NOT_FOUND" -1279870712
"AVERROR_INVALIDDATA" -1094995529
"AVERROR_MUXER_NOT_FOUND" -1481985528
"AVERROR_OPTION_NOT_FOUND" -1414549496
"AVERROR_PATCHWELCOME" -1163346256
"AVERROR_PROTOCOL_NOT_FOUND" -1330794744
"AVERROR_STREAM_NOT_FOUND" -1381258232
"AVERROR_BUG2" -541545794
"AVERROR_UNKNOWN" -1313558101
"AVERROR_EXPERIMENTAL" -733130664
"AVERROR_INPUT_CHANGED" -1668179713
"AVERROR_OUTPUT_CHANGED" -1668179714
"AVERROR_HTTP_BAD_REQUEST" -808465656
"AVERROR_HTTP_UNAUTHORIZED" -825242872
"AVERROR_HTTP_FORBIDDEN" -858797304
"AVERROR_HTTP_NOT_FOUND" -875574520
"AVERROR_HTTP_OTHER_4XX" -1482175736
"AVERROR_HTTP_SERVER_ERROR" -1482175992
"AVERROR_EAGAIN" -35
}

The example test avclj-test/encode-demo worked after changing error->value-map.

Hmm. What a mess :-). Not sure the best pathway either aside from detecting the OS; glad you got it working though and thanks for the correct constants.

My resolution was to add it as a constant and in or the or branch. I now wonder if avclj works on windows...