1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Description: Replace deprecated FFmpeg API
Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Last-Update: <2015-11-02>
--- info-beamer-1.0~pre3.orig/video.c
+++ info-beamer-1.0~pre3/video.c
@@ -64,9 +64,9 @@ static void video_free(video_t *video) {
if (video->scaler)
sws_freeContext(video->scaler);
if (video->raw_frame)
- av_free(video->raw_frame);
+ av_frame_free(&video->raw_frame);
if (video->scaled_frame)
- av_free(video->scaled_frame);
+ av_frame_free(&video->scaled_frame);
if (video->codec_context)
avcodec_close(video->codec_context);
@@ -78,7 +78,7 @@ static void video_free(video_t *video) {
static int video_open(video_t *video, const char *filename) {
video->finished = 0;
- video->format = PIX_FMT_RGB24;
+ video->format = AV_PIX_FMT_RGB24;
if (avformat_open_input(&video->format_context, filename, NULL, NULL) ||
avformat_find_stream_info(video->format_context, NULL) < 0) {
@@ -143,8 +143,8 @@ static int video_open(video_t *video, co
fprintf(stderr, INFO("fps: %lf\n"), video->fps);
/* Get framebuffers */
- video->raw_frame = avcodec_alloc_frame();
- video->scaled_frame = avcodec_alloc_frame();
+ video->raw_frame = av_frame_alloc();
+ video->scaled_frame = av_frame_alloc();
if (!video->raw_frame || !video->scaled_frame) {
fprintf(stderr, ERROR("cannot preallocate frames\n"));
|