avdevice/sdl2output : fix setting window_size

pull/298/head^2
Martin Vignali 7 years ago
parent 16b4f97b72
commit 644130bcaa
  1. 6
      libavdevice/sdl2.c

@ -206,9 +206,7 @@ static int sdl2_write_header(AVFormatContext *s)
} }
} }
sdl->window_width = sdl->texture_rect.w = codecpar->width; compute_texture_rect(s);
sdl->window_height = sdl->texture_rect.h = codecpar->height;
sdl->texture_rect.x = sdl->texture_rect.y = 0;
if (SDL_CreateWindowAndRenderer(sdl->window_width, sdl->window_height, if (SDL_CreateWindowAndRenderer(sdl->window_width, sdl->window_height,
flags, &sdl->window, &sdl->renderer) != 0){ 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_SetWindowTitle(sdl->window, sdl->window_title);
sdl->texture = SDL_CreateTexture(sdl->renderer, sdl->texture_fmt, SDL_TEXTUREACCESS_STREAMING, 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) { if (!sdl->texture) {
av_log(sdl, AV_LOG_ERROR, "Unable to set create mode: %s\n", SDL_GetError()); av_log(sdl, AV_LOG_ERROR, "Unable to set create mode: %s\n", SDL_GetError());

Loading…
Cancel
Save