1 From 70d093e78087c821c2c944df062f4a8ba10e2625 Mon Sep 17 00:00:00 2001
2 From: Antonio Ospite <ospite@studenti.unina.it>
3 Date: Mon, 18 Mar 2013 11:06:57 +0100
4 Subject: [PATCH] Revert "am7xxx-play: switch to avcodec_encode_video2()"
5 X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb;]yA5<GWI5`6u&+
6 ;6b'@y|8w"wB;4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG
7 !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE
9 This reverts commit b344c71f3e03f912d8b6ee7d96cdd67b31cdf8cc.
11 avcodec_encode_video2() has been introduced in lavc 54.01.0 but Debian Wheezy
12 ships with lavc 53, so for now we should revert this change for the Debian
15 When this patch will be dropped maybe the package should depend on
16 libavcodec54 as the old API may be disabled in the Debian packages.
19 examples/am7xxx-play.c | 29 +++++++++--------------------
20 1 file changed, 9 insertions(+), 20 deletions(-)
22 diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c
23 index 38812a4..0b1fa65 100644
24 --- a/examples/am7xxx-play.c
25 +++ b/examples/am7xxx-play.c
26 @@ -285,12 +285,9 @@ static int am7xxx_play(const char *input_format_string,
30 - uint8_t *out_picture;
31 struct SwsContext *sw_scale_ctx;
33 - AVPacket out_packet;
38 ret = video_input_init(&input_ctx, input_format_string, input_path, input_options);
39 @@ -393,26 +390,20 @@ static int am7xxx_play(const char *input_format_string,
40 picture_scaled->linesize);
42 if (output_ctx.raw_output) {
43 - out_picture = out_buf;
44 out_picture_size = out_buf_size;
46 picture_scaled->quality = (output_ctx.codec_ctx)->global_quality;
47 - av_init_packet(&out_packet);
48 - out_packet.data = NULL;
49 - out_packet.size = 0;
51 - ret = avcodec_encode_video2(output_ctx.codec_ctx,
55 - if (ret < 0 || !got_packet) {
56 + /* TODO: switch to avcodec_encode_video2() eventually */
57 + out_picture_size = avcodec_encode_video(output_ctx.codec_ctx,
61 + if (out_picture_size < 0) {
62 fprintf(stderr, "cannot encode video\n");
63 + ret = out_picture_size;
68 - out_picture = out_packet.data;
69 - out_picture_size = out_packet.size;
73 @@ -423,7 +414,7 @@ static int am7xxx_play(const char *input_format_string,
75 snprintf(filename, NAME_MAX, "out.raw");
76 file = fopen(filename, "wb");
77 - fwrite(out_picture, 1, out_picture_size, file);
78 + fwrite(out_buf, 1, out_picture_size, file);
82 @@ -431,7 +422,7 @@ static int am7xxx_play(const char *input_format_string,
84 (output_ctx.codec_ctx)->width,
85 (output_ctx.codec_ctx)->height,
90 perror("am7xxx_send_image");
91 @@ -440,8 +431,6 @@ static int am7xxx_play(const char *input_format_string,
95 - if (!output_ctx.raw_output)
96 - av_free_packet(&out_packet);
97 av_free_packet(&in_packet);