title: ffmpeg Resource temporarily unavailable
body: <p>I'm trying to encode an audio frame using ffmpeg library and Opus codec
  but i faced with this error : </p>
  
  <p><code>Resource temporarily unavailable</code></p>
  
  <p>My source code : </p>
  
  <pre><code>void encode_audio(uint8_t *frame , int frame_size , void (*onPacket)(uint8_t *packet , int packet_size)){
  if(audio_encoder_codec_context != NULL){
      memset(audio_encoder_frame_buffer , 0 , (size_t) audio_encoder_frame_size);
      swr_convert(
              s16_to_flt_resampler,
              &amp;audio_encoder_frame_buffer,
              audio_encoder_frame_size,
              (const uint8_t **) &amp;frame,
              frame_size
      );
      int result = avcodec_send_frame(audio_encoder_codec_context , audio_encoder_frame);
      while(result &gt;= 0){
          result = avcodec_receive_packet(audio_encoder_codec_context , audio_encoder_packet);
          char *a = malloc(1024);
          av_strerror(result , a , 1024);
          printf("%s\n",a);
          if (result == AVERROR(EAGAIN) || result == AVERROR_EOF || result &lt; 0){
              break;
          }
          onPacket(audio_encoder_packet-&gt;data , audio_encoder_packet-&gt;size);
          av_packet_unref(audio_encoder_packet);
      }
  }
  }
  </code></pre>