Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/indexer.c
| Show First 20 Lines • Show All 903 Lines • ▼ Show 20 Lines | static int index_rebuild_ffmpeg(FFmpegIndexBuilderContext *context, | ||||
| uint64_t stream_size; | uint64_t stream_size; | ||||
| memset(&next_packet, 0, sizeof(AVPacket)); | memset(&next_packet, 0, sizeof(AVPacket)); | ||||
| in_frame = av_frame_alloc(); | in_frame = av_frame_alloc(); | ||||
| stream_size = avio_size(context->iFormatCtx->pb); | stream_size = avio_size(context->iFormatCtx->pb); | ||||
| context->frame_rate = av_q2d(av_get_r_frame_rate_compat(context->iStream)); | context->frame_rate = av_q2d(av_get_r_frame_rate_compat(context->iFormatCtx, context->iStream)); | ||||
| context->pts_time_base = av_q2d(context->iStream->time_base); | context->pts_time_base = av_q2d(context->iStream->time_base); | ||||
| while (av_read_frame(context->iFormatCtx, &next_packet) >= 0) { | while (av_read_frame(context->iFormatCtx, &next_packet) >= 0) { | ||||
| int frame_finished = 0; | int frame_finished = 0; | ||||
| float next_progress = (float)((int)floor(((double) next_packet.pos) * 100 / | float next_progress = (float)((int)floor(((double) next_packet.pos) * 100 / | ||||
| ((double) stream_size) + 0.5)) / 100; | ((double) stream_size) + 0.5)) / 100; | ||||
| if (*progress != next_progress) { | if (*progress != next_progress) { | ||||
| ▲ Show 20 Lines • Show All 451 Lines • Show Last 20 Lines | |||||