aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice
diff options
context:
space:
mode:
authorMartin Vignali <martin.vignali@gmail.com>2018-05-08 11:47:13 +0200
committerMartin Vignali <martin.vignali@gmail.com>2018-05-19 14:55:11 +0200
commit644130bcaa22ed42718e1e0aabcb0e398b8414ff (patch)
tree59dfda7fd569aaec739abcada57a044225b5f759 /libavdevice
parent16b4f97b721dfb1118c5c0acb03e6a4e80726179 (diff)
downloadffmpeg-644130bcaa22ed42718e1e0aabcb0e398b8414ff.tar.gz
avdevice/sdl2output : fix setting window_size
Diffstat (limited to 'libavdevice')
-rw-r--r--libavdevice/sdl2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavdevice/sdl2.c b/libavdevice/sdl2.c
index 48ed977beb..e363df398d 100644
--- a/libavdevice/sdl2.c
+++ b/libavdevice/sdl2.c
@@ -206,9 +206,7 @@ static int sdl2_write_header(AVFormatContext *s)
}
}
- sdl->window_width = sdl->texture_rect.w = codecpar->width;
- sdl->window_height = sdl->texture_rect.h = codecpar->height;
- sdl->texture_rect.x = sdl->texture_rect.y = 0;
+ compute_texture_rect(s);
if (SDL_CreateWindowAndRenderer(sdl->window_width, sdl->window_height,
flags, &sdl->window, &sdl->renderer) != 0){
@@ -219,7 +217,7 @@ static int sdl2_write_header(AVFormatContext *s)
SDL_SetWindowTitle(sdl->window, sdl->window_title);
sdl->texture = SDL_CreateTexture(sdl->renderer, sdl->texture_fmt, SDL_TEXTUREACCESS_STREAMING,
- sdl->window_width, sdl->window_height);
+ codecpar->width, codecpar->height);
if (!sdl->texture) {
av_log(sdl, AV_LOG_ERROR, "Unable to set create mode: %s\n", SDL_GetError());