fixed seeking with WAV and MP3 files and added mono/stereo recording options

This commit is contained in:
itsmattkc
2018-10-28 11:56:01 +11:00
parent d4692b9480
commit 97a8494347
9 changed files with 64 additions and 50 deletions
+2 -2
View File
@@ -114,7 +114,7 @@ void get_clip_frame(Clip* c, long playhead) {
MediaStream* ms = static_cast<Media*>(c->media)->get_stream_from_file_index(c->track < 0, c->media_stream);
int64_t target_pts = playhead_to_timestamp(c, playhead);
int64_t second_pts = qRound(av_q2d(av_inv_q(c->stream->time_base)));
int64_t second_pts = qRound64(av_q2d(av_inv_q(c->stream->time_base)));
int64_t quarter_pts = second_pts >> 2;
if (ms->video_interlacing != VIDEO_PROGRESSIVE) {
target_pts *= 2;
@@ -231,7 +231,7 @@ double playhead_to_clip_seconds(Clip* c, long playhead) {
}
int64_t seconds_to_timestamp(Clip* c, double seconds) {
return qRound((seconds * c->stream->time_base.den)/c->stream->time_base.num) + c->stream->start_time;
return qRound64(seconds * av_q2d(av_inv_q(c->stream->time_base))) + qMax((int64_t) 0, c->stream->start_time);
}
int64_t playhead_to_timestamp(Clip* c, long playhead) {