void ES_PlayGetESBufferStatus ( int *audio_rate,int *vid_rate ) { int ret; struct buf_status vbuf; if( vpcodec == NULL) { *vid_rate=0; } else { ret = codec_get_vbuf_state( vpcodec, &vbuf); *vid_rate = ( vbuf.data_len * 100 )/vbuf.size ; } if( apcodec == NULL ) { *audio_rate=0; } else { ret = codec_get_abuf_state( apcodec, &vbuf); *audio_rate = ( vbuf.data_len * 100 )/vbuf.size ; } }
static int check_acodec_state(codec_para_t *codec, struct adec_status *dec, struct buf_status *buf) { int ret = PLAYER_SUCCESS; ret = codec_get_abuf_state(codec, buf); if (ret != 0) { log_error("codec_get_abuf_state error: %x\n", -ret); } ret = codec_get_adec_state(codec, dec); if (ret != 0) { log_error("codec_get_adec_state error: %x\n", -ret); ret = PLAYER_FAILED; } return 0; }