return 0;
}
if( pos == curr_pos ) return 0;
+ avcodec_flush_buffers(st->codec);
double secs = (double)pos / sample_rate;
int64_t tstmp = secs * st->time_base.den / st->time_base.num;
if( nudge != AV_NOPTS_VALUE ) tstmp += nudge;
avformat_seek_file(fmt_ctx, st->index, -INT64_MAX, tstmp, INT64_MAX, 0);
seek_pos = curr_pos = pos;
- mbsz = 0;
- reset();
- st_eof(0);
+ reset(); st_eof(0);
+ mbsz = 0; flushed = 0; need_packet = 1;
return 1;
}
if( gop < 4 ) gop = 4;
if( gop > 64 ) gop = 64;
if( pos >= curr_pos && pos <= curr_pos + gop ) return 0;
+ avcodec_flush_buffers(st->codec);
// back up a few frames to read up to current to help repair damages
if( (pos-=gop) < 0 ) pos = 0;
double secs = (double)pos / frame_rate;
avformat_seek_file(fmt_ctx, st->index, -INT64_MAX, tstmp, INT64_MAX, 0);
seek_pos = curr_pos = pos;
st_eof(0);
+ flushed = 0; need_packet = 1;
return 1;
}
int reading, writing;
int eof;
- int st_eof() {
- return eof;
- }
- void st_eof(int v) {
- if( !v ) { flushed = 0; need_packet = 1; }
- eof = v;
- }
+ int st_eof() { return eof; }
+ void st_eof(int v) { eof = v; }
};
class FFAudioStream : public FFStream {
select_asset(0, 0);
edl->local_session->preview_start = 0;
edl->local_session->preview_end = edl->tracks->total_playable_length();
+ edl->local_session->loop_playback = 0;
edl->local_session->set_selectionstart(0);
edl->local_session->set_selectionend(0);
fit_selection();