Commit 400378b7 authored by Matthieu Bouron's avatar Matthieu Bouron

doc/examples/extract_mvs: re-indent after previous commit

parent 1cf93196
...@@ -35,40 +35,40 @@ static int video_frame_count = 0; ...@@ -35,40 +35,40 @@ static int video_frame_count = 0;
static int decode_packet(const AVPacket *pkt) static int decode_packet(const AVPacket *pkt)
{ {
int ret = avcodec_send_packet(video_dec_ctx, pkt); int ret = avcodec_send_packet(video_dec_ctx, pkt);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "Error while sending a packet to the decoder: %s\n", av_err2str(ret)); fprintf(stderr, "Error while sending a packet to the decoder: %s\n", av_err2str(ret));
return ret;
}
while (ret >= 0) {
ret = avcodec_receive_frame(video_dec_ctx, frame);
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
break;
} else if (ret < 0) {
fprintf(stderr, "Error while receiving a frame from the decoder: %s\n", av_err2str(ret));
return ret; return ret;
} }
while (ret >= 0) { if (ret >= 0) {
ret = avcodec_receive_frame(video_dec_ctx, frame); int i;
if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) { AVFrameSideData *sd;
break;
} else if (ret < 0) { video_frame_count++;
fprintf(stderr, "Error while receiving a frame from the decoder: %s\n", av_err2str(ret)); sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MOTION_VECTORS);
return ret; if (sd) {
} const AVMotionVector *mvs = (const AVMotionVector *)sd->data;
for (i = 0; i < sd->size / sizeof(*mvs); i++) {
if (ret >= 0) { const AVMotionVector *mv = &mvs[i];
int i; printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
AVFrameSideData *sd; video_frame_count, mv->source,
mv->w, mv->h, mv->src_x, mv->src_y,
video_frame_count++; mv->dst_x, mv->dst_y, mv->flags);
sd = av_frame_get_side_data(frame, AV_FRAME_DATA_MOTION_VECTORS);
if (sd) {
const AVMotionVector *mvs = (const AVMotionVector *)sd->data;
for (i = 0; i < sd->size / sizeof(*mvs); i++) {
const AVMotionVector *mv = &mvs[i];
printf("%d,%2d,%2d,%2d,%4d,%4d,%4d,%4d,0x%"PRIx64"\n",
video_frame_count, mv->source,
mv->w, mv->h, mv->src_x, mv->src_y,
mv->dst_x, mv->dst_y, mv->flags);
}
} }
av_frame_unref(frame);
} }
av_frame_unref(frame);
} }
}
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment