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

avcodec: reduce indentation, fix spelling

parent a294d6af
...@@ -1144,14 +1144,13 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, ...@@ -1144,14 +1144,13 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
msg_Dbg( p_dec, "Available decoder output format %d (%s)", pi_fmt[i], msg_Dbg( p_dec, "Available decoder output format %d (%s)", pi_fmt[i],
name ? name : "unknown" ); name ? name : "unknown" );
vlc_va_t *p_va = NULL;
#ifdef HAVE_AVCODEC_VAAPI #ifdef HAVE_AVCODEC_VAAPI
/* Only VLD supported */ /* Only VLD supported */
if( pi_fmt[i] == PIX_FMT_VAAPI_VLD ) if( pi_fmt[i] == PIX_FMT_VAAPI_VLD )
{ {
msg_Dbg( p_dec, "Trying VA API" ); msg_Dbg( p_dec, "Trying VA API" );
p_sys->p_va = vlc_va_NewVaapi( VLC_OBJECT(p_dec), p_sys->i_codec_id ); p_va = vlc_va_NewVaapi( VLC_OBJECT(p_dec), p_sys->i_codec_id );
if( !p_sys->p_va )
msg_Warn( p_dec, "Failed to open VA API" );
} }
#endif #endif
...@@ -1159,9 +1158,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, ...@@ -1159,9 +1158,7 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
if( pi_fmt[i] == PIX_FMT_DXVA2_VLD ) if( pi_fmt[i] == PIX_FMT_DXVA2_VLD )
{ {
msg_Dbg( p_dec, "Trying DXVA2" ); msg_Dbg( p_dec, "Trying DXVA2" );
p_sys->p_va = vlc_va_NewDxva2( VLC_OBJECT(p_dec), p_sys->i_codec_id ); p_va = vlc_va_NewDxva2( VLC_OBJECT(p_dec), p_sys->i_codec_id );
if( !p_sys->p_va )
msg_Warn( p_dec, "Failed to open DXVA2" );
} }
#endif #endif
...@@ -1169,41 +1166,40 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context, ...@@ -1169,41 +1166,40 @@ static enum PixelFormat ffmpeg_GetFormat( AVCodecContext *p_context,
if( pi_fmt[i] == PIX_FMT_VDA_VLD ) if( pi_fmt[i] == PIX_FMT_VDA_VLD )
{ {
msg_Dbg( p_dec, "Trying VDA" ); msg_Dbg( p_dec, "Trying VDA" );
p_sys->p_va = vlc_va_NewVDA( VLC_OBJECT(p_dec), p_sys->i_codec_id, p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra ); p_va = vlc_va_NewVDA( VLC_OBJECT(p_dec), p_sys->i_codec_id, p_dec->fmt_in.p_extra, p_dec->fmt_in.i_extra );
if( !p_sys->p_va )
msg_Warn( p_dec, "Failed to open VDA" );
} }
#endif #endif
if( p_va == NULL )
if( p_sys->p_va && {
p_context->width > 0 && p_context->height > 0 ) msg_Dbg( p_dec, "acceleration not available" );
continue;
}
if( p_context->width > 0 && p_context->height > 0 )
{ {
/* We try to call vlc_va_Setup when possible to detect errors when /* We try to call vlc_va_Setup when possible to detect errors when
* possible (later is too late) */ * possible (later is too late) */
if( vlc_va_Setup( p_sys->p_va, if( vlc_va_Setup( p_va, &p_context->hwaccel_context,
&p_context->hwaccel_context,
&p_dec->fmt_out.video.i_chroma, &p_dec->fmt_out.video.i_chroma,
p_context->width, p_context->height ) ) p_context->width, p_context->height ) )
{ {
msg_Err( p_dec, "vlc_va_Setup failed" ); msg_Err( p_dec, "vlc_va_Setup failed" );
vlc_va_Delete( p_sys->p_va ); vlc_va_Delete( p_va );
p_sys->p_va = NULL; continue;
} }
} }
if( p_sys->p_va ) p_sys->p_va = p_va;
{ if( p_va->description )
if( p_sys->p_va->description ) msg_Info( p_dec, "Using %s for hardware decoding.",
msg_Info( p_dec, "Using %s for hardware decoding.", p_sys->p_va->description ); p_va->description );
/* FIXME this will disabled direct rendering /* FIXME this will disable direct rendering
* even if a new pixel format is renegociated * even if a new pixel format is renegotiated
*/ */
p_sys->b_direct_rendering = false; p_sys->b_direct_rendering = false;
p_context->draw_horiz_band = NULL; p_context->draw_horiz_band = NULL;
return pi_fmt[i]; return pi_fmt[i];
} }
}
/* Fallback to default behaviour */ /* Fallback to default behaviour */
return avcodec_default_get_format( p_context, pi_fmt ); return avcodec_default_get_format( p_context, pi_fmt );
......
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