[vlc-commits] [Git][videolan/vlc][master] avcodec: only set the i_codec when the i_chroma is valid

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Apr 5 08:09:53 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
8618e521 by Steve Lhomme at 2023-04-05T07:49:30+00:00
avcodec: only set the i_codec when the i_chroma is valid

If it's not set yet, it will be set later. We only need to know the value
before we call decoder_UpdateVideoOutput().

- - - - -


1 changed file:

- modules/codec/avcodec/video.c


Changes:

=====================================
modules/codec/avcodec/video.c
=====================================
@@ -574,12 +574,8 @@ int InitVideoDec( vlc_object_t *obj )
     p_sys->framedrop = FRAMEDROP_NONE;
 
     /* Set output properties */
-    if( GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) != VLC_SUCCESS )
-    {
-        /* we are doomed. but not really, because most codecs set their pix_fmt later on */
-        p_dec->fmt_out.i_codec = VLC_CODEC_I420;
-    }
-    p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
+    if (GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) == VLC_SUCCESS)
+        p_dec->fmt_out.i_codec = p_dec->fmt_out.video.i_chroma;
 
     p_dec->fmt_out.video.orientation = p_dec->fmt_in->video.orientation;
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8618e521d8a20e7e374c0f3e843c92f110576308

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8618e521d8a20e7e374c0f3e843c92f110576308
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list