1 diff --git a/examples/am7xxx-play.c b/examples/am7xxx-play.c
2 index 46a91c9..fed455f 100644
3 --- a/examples/am7xxx-play.c
4 +++ b/examples/am7xxx-play.c
7 #include <libavdevice/avdevice.h>
8 #include <libavformat/avformat.h>
9 -#include <libavutil/imgutils.h>
10 #include <libswscale/swscale.h>
13 @@ -308,7 +307,7 @@ static int am7xxx_play(const char *input_format_string,
16 /* allocate an input frame */
17 - picture_raw = av_frame_alloc();
18 + picture_raw = avcodec_alloc_frame();
19 if (picture_raw == NULL) {
20 fprintf(stderr, "cannot allocate the raw picture frame!\n");
22 @@ -316,7 +315,7 @@ static int am7xxx_play(const char *input_format_string,
25 /* allocate output frame */
26 - picture_scaled = av_frame_alloc();
27 + picture_scaled = avcodec_alloc_frame();
28 if (picture_scaled == NULL) {
29 fprintf(stderr, "cannot allocate the scaled picture!\n");
31 @@ -327,10 +326,9 @@ static int am7xxx_play(const char *input_format_string,
32 picture_scaled->height = (output_ctx.codec_ctx)->height;
34 /* calculate the bytes needed for the output image and create buffer for the output image */
35 - out_buf_size = av_image_get_buffer_size((output_ctx.codec_ctx)->pix_fmt,
36 - (output_ctx.codec_ctx)->width,
37 - (output_ctx.codec_ctx)->height,
39 + out_buf_size = avpicture_get_size((output_ctx.codec_ctx)->pix_fmt,
40 + (output_ctx.codec_ctx)->width,
41 + (output_ctx.codec_ctx)->height);
42 out_buf = av_malloc(out_buf_size * sizeof(uint8_t));
43 if (out_buf == NULL) {
44 fprintf(stderr, "cannot allocate output data buffer!\n");
45 @@ -339,13 +337,11 @@ static int am7xxx_play(const char *input_format_string,
48 /* assign appropriate parts of buffer to image planes in picture_scaled */
49 - av_image_fill_arrays(picture_scaled->data,
50 - picture_scaled->linesize,
52 - (output_ctx.codec_ctx)->pix_fmt,
53 - (output_ctx.codec_ctx)->width,
54 - (output_ctx.codec_ctx)->height,
56 + avpicture_fill((AVPicture *)picture_scaled,
58 + (output_ctx.codec_ctx)->pix_fmt,
59 + (output_ctx.codec_ctx)->width,
60 + (output_ctx.codec_ctx)->height);
62 sw_scale_ctx = sws_getCachedContext(NULL,
63 (input_ctx.codec_ctx)->width,
64 @@ -458,17 +454,17 @@ static int am7xxx_play(const char *input_format_string,
67 if (!output_ctx.raw_output && got_packet)
68 - av_packet_unref(&out_packet);
69 - av_packet_unref(&in_packet);
70 + av_free_packet(&out_packet);
71 + av_free_packet(&in_packet);
74 sws_freeContext(sw_scale_ctx);
77 cleanup_picture_scaled:
78 - av_frame_free(&picture_scaled);
79 + avcodec_free_frame(&picture_scaled);
81 - av_frame_free(&picture_raw);
82 + avcodec_free_frame(&picture_raw);
85 /* av_free is needed as well,
86 diff --git a/src/am7xxx.c b/src/am7xxx.c
87 index 84d7e9c..f26fc18 100644
90 @@ -1106,7 +1106,7 @@ AM7XXX_PUBLIC int am7xxx_init(am7xxx_context **ctx)
91 goto out_free_context;
94 - libusb_set_debug((*ctx)->usb_context, LIBUSB_LOG_LEVEL_INFO);
95 + libusb_set_debug((*ctx)->usb_context, 3);
97 ret = scan_devices(*ctx, SCAN_OP_BUILD_DEVLIST , 0, NULL);