+
+ decode_activate();
+ for( int i=0; i<(int)fmt_ctx->nb_streams; ++i ) {
+ AVStream *st = fmt_ctx->streams[i];
+ AVCodecContext *avctx = st->codec;
+ if( avctx->codec_type != AVMEDIA_TYPE_AUDIO ) continue;
+ int64_t tstmp = st->start_time;
+ if( tstmp == AV_NOPTS_VALUE ) continue;
+ int aidx = ffaudio.size();
+ while( --aidx>=0 && ffaudio[aidx]->fidx != i );
+ if( aidx < 0 ) continue;
+ FFAudioStream *aud = ffaudio[aidx];
+ tstmp -= aud->nudge;
+ double secs = to_secs(tstmp, st->time_base);
+ aud->curr_pos = secs * aud->sample_rate + 0.5;
+ }
+