fixed #95 and added minimal support for #66

This commit is contained in:
itsmattkc
2018-07-08 12:19:07 +01:00
parent a31a3d8c75
commit 0b739fcb76
17 changed files with 261 additions and 165 deletions
+2 -6
View File
@@ -189,12 +189,8 @@ long seconds_to_clip_frame(Clip* c, float seconds) {
}
float clip_frame_to_seconds(Clip* c, long clip_frame) {
// returns frame number as seconds (decimal)
if (c->stream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
return (double) clip_frame / av_q2d(c->stream->avg_frame_rate);
} else {
return (double) clip_frame / c->sequence->frame_rate;
}
// returns frame number in decimal seconds
return (float) clip_frame / c->sequence->frame_rate;
}
int retrieve_next_frame(Clip* c, AVFrame* f) {