Commit 6f7a7ea3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

avcodec: do not initialize output format with a nul dimension

This should never happen, and it would not work. We need the real
dimensions to initialize the video output thread.
parent 85b5b4e0
...@@ -1125,6 +1125,11 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, ...@@ -1125,6 +1125,11 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
p_dec->fmt_out.video.i_chroma = vlc_va_GetChroma(hwfmt, swfmt); p_dec->fmt_out.video.i_chroma = vlc_va_GetChroma(hwfmt, swfmt);
if (p_dec->fmt_out.video.i_chroma == 0) if (p_dec->fmt_out.video.i_chroma == 0)
continue; /* Unknown brand of hardware acceleration */ continue; /* Unknown brand of hardware acceleration */
if (p_context->width == 0 || p_context->height == 0)
{ /* should never happen */
msg_Err(p_dec, "unspecified video dimensions");
continue;
}
if (lavc_UpdateVideoFormat(p_dec, p_context, true)) if (lavc_UpdateVideoFormat(p_dec, p_context, true))
continue; /* Unsupported brand of hardware acceleration */ continue; /* Unsupported brand of hardware acceleration */
...@@ -1138,10 +1143,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, ...@@ -1138,10 +1143,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
if (va == NULL) if (va == NULL)
continue; /* Unsupported codec profile or such */ continue; /* Unsupported codec profile or such */
/* We try to call vlc_va_Setup when possible to detect errors when if (vlc_va_Setup(va, p_context, &p_dec->fmt_out.video.i_chroma))
* possible (later is too late) */
if( p_context->width > 0 && p_context->height > 0
&& vlc_va_Setup(va, p_context, &p_dec->fmt_out.video.i_chroma))
{ {
msg_Err( p_dec, "acceleration setup failure" ); msg_Err( p_dec, "acceleration setup failure" );
vlc_va_Delete(va, p_context); vlc_va_Delete(va, p_context);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment