[vlc-commits] [Git][videolan/vlc][master] subpicture: ensure all subtitle decoders set the b_subtitle flag

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Mar 28 18:59:41 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d8680da9 by Steve Lhomme at 2024-03-28T16:52:10+00:00
subpicture: ensure all subtitle decoders set the b_subtitle flag

It wasn't set in the test decoder callback.

- - - - -


3 changed files:

- include/vlc_codec.h
- modules/stream_out/transcode/spu.c
- src/input/decoder.c


Changes:

=====================================
include/vlc_codec.h
=====================================
@@ -516,6 +516,8 @@ static inline subpicture_t *decoder_NewSubpicture( decoder_t *dec,
     subpicture_t *p_subpicture = dec->cbs->spu.buffer_new( dec, p_dyn );
     if( !p_subpicture )
         msg_Warn( dec, "can't get output subpicture" );
+    else
+        p_subpicture->b_subtitle = true;
     return p_subpicture;
 }
 


=====================================
modules/stream_out/transcode/spu.c
=====================================
@@ -44,10 +44,7 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
                                      const subpicture_updater_t *p_upd )
 {
     VLC_UNUSED( p_dec );
-    subpicture_t *p_subpicture = subpicture_New( p_upd );
-    if( likely(p_subpicture != NULL) )
-        p_subpicture->b_subtitle = true;
-    return p_subpicture;
+    return subpicture_New( p_upd );
 }
 
 static void decoder_queue_sub( decoder_t *p_dec, subpicture_t *p_spu )


=====================================
src/input/decoder.c
=====================================
@@ -953,7 +953,6 @@ static subpicture_t *ModuleThread_NewSpuBuffer( decoder_t *p_dec,
     {
         p_subpic->i_channel = p_owner->i_spu_channel;
         p_subpic->i_order = p_owner->i_spu_order++;
-        p_subpic->b_subtitle = true;
     }
 
     return p_subpic;



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d8680da9f2ece57612e9f3cd7d46ff54367a5d27
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