MCPcopy Create free account
hub / github.com/codestation/qcma / seekVideo

Method seekVideo

common/avdecoder.cpp:173–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172
173bool AVDecoder::seekVideo(int percentage)
174{
175 if(!loadCodec(CODEC_VIDEO)) {
176 return false;
177 }
178
179 qint64 seek_pos = pFormatCtx->duration * percentage / (AV_TIME_BASE * 100);
180 qint64 frame = av_rescale(seek_pos, av_stream->time_base.den, av_stream->time_base.num);
181
182 return avformat_seek_file(pFormatCtx, stream_index, 0, frame, frame, AVSEEK_FLAG_FRAME) >= 0;
183}
184
185static void calculate_thumbnail_dimensions(int src_width, int src_height,
186 int src_sar_num, int src_sar_den,

Callers 1

ifFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected