ret = read_frame(frame);
if( ret > 0 ) ++curr_pos;
}
- if( ret > 0 ) {
+ if( ret >= 0 ) {
AVCodecContext *ctx = st->codec;
ret = convert_cmodel(vframe, (AVPicture *)frame,
ctx->pix_fmt, ctx->width, ctx->height);
{
int aidx = astrm_index[stream].st_idx;
FFAudioStream *aud = ffaudio[aidx];
- pos = pos * aud->sample_rate / file_base->asset->sample_rate + 0.5;
aud->audio_seek(pos);
return 0;
}
{
int vidx = vstrm_index[stream].st_idx;
FFVideoStream *vid = ffvideo[vidx];
- pos = pos * vid->frame_rate / file_base->asset->frame_rate + 0.5;
vid->video_seek(pos);
return 0;
}
if( !has_audio || chn >= astrm_index.size() ) return -1;
int aidx = astrm_index[chn].st_idx;
FFAudioStream *aud = ffaudio[aidx];
- pos = pos * aud->sample_rate / file_base->asset->sample_rate + 0.5;
if( aud->load(pos, len) < len ) return -1;
int ch = astrm_index[chn].st_ch;
int ret = aud->read(samples,len,ch);
if( !has_video || layer >= vstrm_index.size() ) return -1;
int vidx = vstrm_index[layer].st_idx;
FFVideoStream *vid = ffvideo[vidx];
- pos = pos * vid->frame_rate / file_base->asset->frame_rate + 0.5;
return vid->load(vframe, pos);
}