[FFmpeg-devel] av_read_frame return -32 before EOF in case of gsm_ms/gsm wav files
Gaurav
objectgaurav at gmail.com
Fri Sep 9 09:01:43 CEST 2011
av_read_frame function is returning -32 after 5/6 frames but I have very large
file. This behaviour of the code is only for libgsm wav files only. If I play
.mp3 or other wav files there is no error.
Can some one help me why av_read_frame return -32 before EOF in case of
libgsm_ms file on android platfrom.
Below id my source code:
while (mCurrentState != MEDIA_PLAYER_DECODED
&& mCurrentState != MEDIA_PLAYER_STOPPED
&& mCurrentState != MEDIA_PLAYER_STATE_ERROR )
{
__android_log_print(ANDROID_LOG_INFO, TAG, "Inside Decoder Run Loop.");
if (mDecoderAudio->packets() > FFMPEG_PLAYER_MAX_QUEUE_SIZE) {
__android_log_print(ANDROID_LOG_INFO, TAG, "mDecoderAudio->packets() >
FFMPEG_PLAYER_MAX_QUEUE_SIZE, lets sleep for 2mili sec.");
usleep(200);
continue;
}
__android_log_print(ANDROID_LOG_INFO, TAG, "Lets read frame using
av_read_frame: %u",mMovieFile);
int nResult = av_read_frame(mMovieFile, &pPacket);
__android_log_print(ANDROID_LOG_INFO, TAG, "Read frameresult: %d",nResult);
if(nResult < 0) {
mCurrentState = MEDIA_PLAYER_DECODED;
__android_log_print(ANDROID_LOG_INFO, TAG, "No more frame to decode.");
continue;
}
if(mCurrentState == MEDIA_PLAYER_PAUSED){
__android_log_print(ANDROID_LOG_INFO, TAG,"Player state is
MEDIA_PLAYER_PAUSED.");
continue;
}
if (pPacket.stream_index == mAudioStreamIndex) {
__android_log_print(ANDROID_LOG_INFO, TAG,"Lets Enqueue Packet");
mDecoderAudio->enqueue(&pPacket);
}
else {
__android_log_print(ANDROID_LOG_INFO, TAG,"Lets Free Packet");
av_free_packet(&pPacket);
}
}
More information about the ffmpeg-devel
mailing list