I'm reposting Miranda's message which was sent as private and I hope that by mistake:
There's an obvious problem in your program, I instruct it in the comments: /* When error occurred while mad_frame_decode, you need do some processing */ if (MAD_RECOVERABLE(this->int_stream.error)) { if (this->int_stream.error != MAD_ERROR_LOSTSYNC || this->int_stream.this_frame != guard_start) { qWarning("Recoverable error during MPEG stream decoding: %x!", this->int_stream.error); } // Decode next frame. continue; } else /* The problem occurres here */ { // Out of MPEG frame data? if (this->int_stream.error == MAD_ERROR_BUFLEN) /* MAD_ERROR_BUFLEN is a kind of recoverable error, i.e, MAD_RECOVERABLE(MAD_ERROR_BUFLEN) == 1, so the condition "if (this->int_stream.error == MAD_ERROR_BUFLEN)" here will never be true, and you do need it to be true when there's no enough data in this->int_stream, so you can read new data into buffer from file. */ { qDebug("need data"); // Read next data from file and try to decode aggain. continue; } else { qWarning("Error decoding MPEG stream: %x!", this->int_stream.error); return -1; } } Hope this will help. Best regards, Miranda
--------------------------------- 雅虎免费邮箱3.5G容量,20M附件!