sdl: Remove AVPicture usage
authorTimothy Gu <timothygu99@gmail.com>
Tue, 2 Feb 2016 01:25:38 +0000 (17:25 -0800)
committerTimothy Gu <timothygu99@gmail.com>
Wed, 3 Feb 2016 02:06:13 +0000 (18:06 -0800)
libavdevice/sdl.c

index b98aae5..4cccfe5 100644 (file)
@@ -27,6 +27,7 @@
 #include <SDL_thread.h>
 
 #include "libavutil/avstring.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
 #include "libavutil/pixdesc.h"
@@ -315,22 +316,23 @@ static int sdl_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
     SDLContext *sdl = s->priv_data;
     AVCodecContext *encctx = s->streams[0]->codec;
-    AVPicture pict;
+    uint8_t *data[4];
+    int linesize[4];
     int i;
 
     if (sdl->quit) {
         sdl_write_trailer(s);
         return AVERROR(EIO);
     }
-    avpicture_fill(&pict, pkt->data, encctx->pix_fmt, encctx->width, encctx->height);
+    av_image_fill_arrays(data, linesize, pkt->data, encctx->pix_fmt, encctx->width, encctx->height, 1);
 
     SDL_LockMutex(sdl->mutex);
     SDL_FillRect(sdl->surface, &sdl->surface->clip_rect,
                  SDL_MapRGB(sdl->surface->format, 0, 0, 0));
     SDL_LockYUVOverlay(sdl->overlay);
     for (i = 0; i < 3; i++) {
-        sdl->overlay->pixels [i] = pict.data    [i];
-        sdl->overlay->pitches[i] = pict.linesize[i];
+        sdl->overlay->pixels [i] = data    [i];
+        sdl->overlay->pitches[i] = linesize[i];
     }
     SDL_DisplayYUVOverlay(sdl->overlay, &sdl->overlay_rect);
     SDL_UnlockYUVOverlay(sdl->overlay);