NAME: decoder->message() DESCRIPTION: send a message to and receive a reply from the decoder process */
| 567 | DESCRIPTION: send a message to and receive a reply from the decoder process |
| 568 | */ |
| 569 | int mad_decoder_message(struct mad_decoder *decoder, |
| 570 | void *message, unsigned int *len) |
| 571 | { |
| 572 | # if defined(USE_ASYNC) |
| 573 | if (decoder->mode != MAD_DECODER_MODE_ASYNC || |
| 574 | send(decoder->async.out, message, *len) != MAD_FLOW_CONTINUE || |
| 575 | receive(decoder->async.in, &message, len) != MAD_FLOW_CONTINUE) |
| 576 | return -1; |
| 577 | |
| 578 | return 0; |
| 579 | # else |
| 580 | (void) decoder; |
| 581 | (void) message; |
| 582 | (void) len; |
| 583 | return -1; |
| 584 | # endif |
| 585 | } |