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

avcodec: minor code factor

parent 793671b6
...@@ -122,9 +122,12 @@ static int lavc_UpdateVideoFormat( decoder_t *p_dec, ...@@ -122,9 +122,12 @@ static int lavc_UpdateVideoFormat( decoder_t *p_dec,
{ {
int aligns[AV_NUM_DATA_POINTERS]; int aligns[AV_NUM_DATA_POINTERS];
if (GetVlcChroma(&p_dec->fmt_out.video, p_context->pix_fmt))
return -1;
avcodec_align_dimensions2(p_context, &width, &height, aligns); avcodec_align_dimensions2(p_context, &width, &height, aligns);
} }
p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
if( width == 0 || height == 0 || width > 8192 || height > 8192 ) if( width == 0 || height == 0 || width > 8192 || height > 8192 )
{ {
...@@ -145,11 +148,6 @@ static int lavc_UpdateVideoFormat( decoder_t *p_dec, ...@@ -145,11 +148,6 @@ static int lavc_UpdateVideoFormat( decoder_t *p_dec,
p_dec->fmt_out.video.i_visible_height = height; p_dec->fmt_out.video.i_visible_height = height;
} }
if( !hwaccel && GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) )
return -1;
p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
/* If an aspect-ratio was specified in the input format then force it */ /* If an aspect-ratio was specified in the input format then force it */
if( p_dec->fmt_in.video.i_sar_num > 0 && p_dec->fmt_in.video.i_sar_den > 0 ) if( p_dec->fmt_in.video.i_sar_num > 0 && p_dec->fmt_in.video.i_sar_den > 0 )
{ {
......
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