summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Gu <timothygu99@gmail.com>2016-02-01 17:25:38 -0800
committerTimothy Gu <timothygu99@gmail.com>2016-02-02 18:06:13 -0800
commit228eb6708bd708bd778181ae91a7349eb803fed6 (patch)
treecd48eb3fe3d75e3cd30ed2d09106210ab55d491f
parent916da13d6dac8b0d3e8f7b1cb87fa37801cee3f8 (diff)
downloadffmpeg-228eb6708bd708bd778181ae91a7349eb803fed6.tar.gz
sdl: Remove AVPicture usage
-rw-r--r--libavdevice/sdl.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavdevice/sdl.c b/libavdevice/sdl.c
index b98aae5eeb..4cccfe528a 100644
--- a/libavdevice/sdl.c
+++ b/libavdevice/sdl.c
@@ -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);