[vlc-commits] vlc_subpicture: respect ODR in updater_sys
Francois Cartegnie
git at videolan.org
Mon May 14 21:23:22 CEST 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May 14 20:56:36 2018 +0200| [66926f600c00d43cc4be6beec9164b44ba7a01bf] | committer: Francois Cartegnie
vlc_subpicture: respect ODR in updater_sys
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=66926f600c00d43cc4be6beec9164b44ba7a01bf
---
include/vlc_subpicture.h | 3 +--
modules/access/bluray.c | 22 ++++++++++++----------
modules/codec/arib/aribsub.c | 2 +-
modules/codec/arib/substext.h | 14 +++++++-------
modules/codec/cc.c | 6 +++---
modules/codec/cea708.c | 2 +-
modules/codec/kate.c | 21 ++++++++++++---------
modules/codec/libass.c | 26 ++++++++++++++------------
modules/codec/scte18.c | 2 +-
modules/codec/stl.c | 2 +-
modules/codec/subsdec.c | 2 +-
modules/codec/substext.h | 14 +++++++-------
modules/codec/substx3g.c | 2 +-
modules/codec/textst.c | 3 ++-
modules/codec/ttml/substtml.c | 2 +-
modules/codec/webvtt/subsvtt.c | 7 +++++--
modules/codec/zvbi.c | 4 ++--
modules/spu/subsdelay.c | 4 ++--
src/video_output/video_epg.c | 14 +++++++-------
src/video_output/video_text.c | 10 +++++-----
src/video_output/video_widgets.c | 8 ++++----
21 files changed, 90 insertions(+), 80 deletions(-)
diff --git a/include/vlc_subpicture.h b/include/vlc_subpicture.h
index fad5eb0013..6a734420ae 100644
--- a/include/vlc_subpicture.h
+++ b/include/vlc_subpicture.h
@@ -118,7 +118,6 @@ VLC_API subpicture_region_t *subpicture_region_Copy( subpicture_region_t *p_regi
/**
*
*/
-typedef struct subpicture_updater_sys_t subpicture_updater_sys_t;
typedef struct
{
/** Optional pre update callback, usually useful on video format change.
@@ -137,7 +136,7 @@ typedef struct
mtime_t );
/** Optional callback for subpicture private data cleanup */
void (*pf_destroy) ( subpicture_t * );
- subpicture_updater_sys_t *p_sys;
+ void *p_sys;
} subpicture_updater_t;
typedef struct subpicture_private_t subpicture_private_t;
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 293d1cd440..549f245c14 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -129,6 +129,8 @@ typedef enum OverlayStatus {
Outdated //used to update the overlay after it has been sent to the vout
} OverlayStatus;
+typedef struct bluray_spu_updater_sys_t bluray_spu_updater_sys_t;
+
typedef struct bluray_overlay_t
{
vlc_mutex_t lock;
@@ -142,7 +144,7 @@ typedef struct bluray_overlay_t
* - the overlay is closed
* - vout is changed and this overlay is sent to the new vout
*/
- struct subpicture_updater_sys_t *p_updater;
+ bluray_spu_updater_sys_t *p_updater;
} bluray_overlay_t;
typedef struct
@@ -202,7 +204,7 @@ typedef struct
char *psz_bd_path;
} demux_sys_t;
-struct subpicture_updater_sys_t
+struct bluray_spu_updater_sys_t
{
vlc_mutex_t lock; // protect p_overlay pointer and ref_cnt
bluray_overlay_t *p_overlay; // NULL if overlay has been closed
@@ -212,9 +214,9 @@ struct subpicture_updater_sys_t
/*
* cut the connection between vout and overlay.
* - called when vout is closed or overlay is closed.
- * - frees subpicture_updater_sys_t when both sides have been closed.
+ * - frees bluray_spu_updater_sys_t when both sides have been closed.
*/
-static void unref_subpicture_updater(subpicture_updater_sys_t *p_sys)
+static void unref_subpicture_updater(bluray_spu_updater_sys_t *p_sys)
{
vlc_mutex_lock(&p_sys->lock);
int refs = --p_sys->ref_cnt;
@@ -1134,7 +1136,7 @@ static es_out_t *esOutNew(demux_t *p_demux)
* subpicture_updater_t functions:
*****************************************************************************/
-static bluray_overlay_t *updater_lock_overlay(subpicture_updater_sys_t *p_upd_sys)
+static bluray_overlay_t *updater_lock_overlay(bluray_spu_updater_sys_t *p_upd_sys)
{
/* this lock is held while vout accesses overlay. => overlay can't be closed. */
vlc_mutex_lock(&p_upd_sys->lock);
@@ -1151,7 +1153,7 @@ static bluray_overlay_t *updater_lock_overlay(subpicture_updater_sys_t *p_upd_sy
return NULL;
}
-static void updater_unlock_overlay(subpicture_updater_sys_t *p_upd_sys)
+static void updater_unlock_overlay(bluray_spu_updater_sys_t *p_upd_sys)
{
assert (p_upd_sys->p_overlay);
@@ -1170,7 +1172,7 @@ static int subpictureUpdaterValidate(subpicture_t *p_subpic,
VLC_UNUSED(p_fmt_dst);
VLC_UNUSED(i_ts);
- subpicture_updater_sys_t *p_upd_sys = p_subpic->updater.p_sys;
+ bluray_spu_updater_sys_t *p_upd_sys = p_subpic->updater.p_sys;
bluray_overlay_t *p_overlay = updater_lock_overlay(p_upd_sys);
if (!p_overlay) {
@@ -1192,7 +1194,7 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
VLC_UNUSED(p_fmt_src);
VLC_UNUSED(p_fmt_dst);
VLC_UNUSED(i_ts);
- subpicture_updater_sys_t *p_upd_sys = p_subpic->updater.p_sys;
+ bluray_spu_updater_sys_t *p_upd_sys = p_subpic->updater.p_sys;
bluray_overlay_t *p_overlay = updater_lock_overlay(p_upd_sys);
if (!p_overlay) {
@@ -1226,7 +1228,7 @@ static void subpictureUpdaterUpdate(subpicture_t *p_subpic,
static void subpictureUpdaterDestroy(subpicture_t *p_subpic)
{
- subpicture_updater_sys_t *p_upd_sys = p_subpic->updater.p_sys;
+ bluray_spu_updater_sys_t *p_upd_sys = p_subpic->updater.p_sys;
bluray_overlay_t *p_overlay = updater_lock_overlay(p_upd_sys);
if (p_overlay) {
@@ -1241,7 +1243,7 @@ static void subpictureUpdaterDestroy(subpicture_t *p_subpic)
static subpicture_t *bluraySubpictureCreate(bluray_overlay_t *p_ov)
{
- subpicture_updater_sys_t *p_upd_sys = malloc(sizeof(*p_upd_sys));
+ bluray_spu_updater_sys_t *p_upd_sys = malloc(sizeof(*p_upd_sys));
if (unlikely(p_upd_sys == NULL)) {
return NULL;
}
diff --git a/modules/codec/arib/aribsub.c b/modules/codec/arib/aribsub.c
index d984d17572..1cf978b9c7 100644
--- a/modules/codec/arib/aribsub.c
+++ b/modules/codec/arib/aribsub.c
@@ -268,7 +268,7 @@ static subpicture_t *render( decoder_t *p_dec, arib_parser_t *p_parser,
p_spu->b_ephemer = (p_spu->i_start == p_spu->i_stop);
p_spu->b_absolute = true;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ arib_spu_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
arib_text_region_t *p_region = p_spu_sys->p_region =
(arib_text_region_t*) calloc( 1, sizeof(arib_text_region_t) );
diff --git a/modules/codec/arib/substext.h b/modules/codec/arib/substext.h
index a1bba0ca61..6c89862a9b 100644
--- a/modules/codec/arib/substext.h
+++ b/modules/codec/arib/substext.h
@@ -40,17 +40,17 @@ typedef struct arib_text_region_s
struct arib_text_region_s *p_next;
} arib_text_region_t;
-struct subpicture_updater_sys_t
+typedef struct
{
arib_text_region_t *p_region;
-};
+} arib_spu_updater_sys_t;
static int SubpictureTextValidate(subpicture_t *subpic,
bool has_src_changed, const video_format_t *fmt_src,
bool has_dst_changed, const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ arib_spu_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src); VLC_UNUSED(fmt_dst); VLC_UNUSED(ts);
VLC_UNUSED(sys);
@@ -65,7 +65,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ arib_spu_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
if (fmt_dst->i_sar_num <= 0 || fmt_dst->i_sar_den <= 0)
@@ -119,7 +119,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
}
static void SubpictureTextDestroy(subpicture_t *subpic)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ arib_spu_updater_sys_t *sys = subpic->updater.p_sys;
arib_text_region_t *p_region, *p_region_next;
for( p_region = sys->p_region; p_region; p_region = p_region_next )
@@ -135,8 +135,8 @@ static void SubpictureTextDestroy(subpicture_t *subpic)
static inline subpicture_t *decoder_NewSubpictureText(decoder_t *decoder)
{
- subpicture_updater_sys_t *sys = (subpicture_updater_sys_t*)
- calloc( 1, sizeof(subpicture_updater_sys_t) );
+ arib_spu_updater_sys_t *sys = (arib_spu_updater_sys_t*)
+ calloc( 1, sizeof(arib_spu_updater_sys_t) );
subpicture_updater_t updater = {
.pf_validate = SubpictureTextValidate,
.pf_update = SubpictureTextUpdate,
diff --git a/modules/codec/cc.c b/modules/codec/cc.c
index 08fb9dd884..3b7f22bfbc 100644
--- a/modules/codec/cc.c
+++ b/modules/codec/cc.c
@@ -206,7 +206,7 @@ typedef struct
static void Eia608Init( eia608_t * );
static eia608_status_t Eia608Parse( eia608_t *h, int i_channel_selected, const uint8_t data[2] );
-static void Eia608FillUpdaterRegions( subpicture_updater_sys_t *p_updater, eia608_t *h );
+static void Eia608FillUpdaterRegions( subtext_updater_sys_t *p_updater, eia608_t *h );
/* It will be enough up to 63 B frames, which is far too high for
* broadcast environment */
@@ -501,7 +501,7 @@ static subpicture_t *Subtitle( decoder_t *p_dec, eia608_t *h, mtime_t i_pts )
p_spu->b_ephemer = true;
p_spu->b_absolute = false;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
decoder_sys_t *p_dec_sys = p_dec->p_sys;
/* Set first region defaults */
@@ -1204,7 +1204,7 @@ static text_segment_t * Eia608TextLine( struct eia608_screen *screen, int i_row
return p_segments_head;
}
-static void Eia608FillUpdaterRegions( subpicture_updater_sys_t *p_updater, eia608_t *h )
+static void Eia608FillUpdaterRegions( subtext_updater_sys_t *p_updater, eia608_t *h )
{
struct eia608_screen *screen = &h->screen[h->i_screen];
substext_updater_region_t *p_region = &p_updater->region;
diff --git a/modules/codec/cea708.c b/modules/codec/cea708.c
index ca3f7a757e..74b6740361 100644
--- a/modules/codec/cea708.c
+++ b/modules/codec/cea708.c
@@ -1046,7 +1046,7 @@ static subpicture_t *CEA708_BuildSubtitle( cea708_t *p_cea708 )
if( !p_spu )
return NULL;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
substext_updater_region_t *p_region = &p_spu_sys->region;
p_spu_sys->margin_ratio = CEA708_SCREEN_SAFE_MARGIN_RATIO;
diff --git a/modules/codec/kate.c b/modules/codec/kate.c
index 5fe146b016..2edd8ac489 100644
--- a/modules/codec/kate.c
+++ b/modules/codec/kate.c
@@ -115,11 +115,11 @@ typedef struct
bool b_use_tiger;
} decoder_sys_t;
-struct subpicture_updater_sys_t
+typedef struct
{
decoder_sys_t *p_dec_sys;
mtime_t i_start;
-};
+} kate_spu_updater_sys_t;
/*
@@ -755,8 +755,9 @@ static void SetupText( decoder_t *p_dec, subpicture_t *p_spu, const kate_event *
static void TigerDestroySubpicture( subpicture_t *p_subpic )
{
- DecSysRelease( p_subpic->updater.p_sys->p_dec_sys );
- free( p_subpic->updater.p_sys );
+ kate_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
+ DecSysRelease( p_spusys->p_dec_sys );
+ free( p_spusys );
}
/*
* We get premultiplied alpha, but VLC doesn't expect this, so we demultiply
@@ -816,7 +817,8 @@ static int TigerValidateSubpicture( subpicture_t *p_subpic,
{
VLC_UNUSED(p_fmt_src); VLC_UNUSED(p_fmt_dst);
- decoder_sys_t *p_sys = p_subpic->updater.p_sys->p_dec_sys;
+ kate_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
+ decoder_sys_t *p_sys = p_spusys->p_dec_sys;
if( b_fmt_src || b_fmt_dst )
return VLC_EGENERIC;
@@ -824,7 +826,7 @@ static int TigerValidateSubpicture( subpicture_t *p_subpic,
PROFILE_START( TigerValidateSubpicture );
/* time in seconds from the start of the stream */
- kate_float t = (p_subpic->updater.p_sys->i_start + ts - p_subpic->i_start ) / 1000000.0f;
+ kate_float t = (p_spusys->i_start + ts - p_subpic->i_start ) / 1000000.0f;
/* it is likely that the current region (if any) can be kept as is; test for this */
vlc_mutex_lock( &p_sys->lock );
@@ -857,14 +859,15 @@ static void TigerUpdateSubpicture( subpicture_t *p_subpic,
const video_format_t *p_fmt_dst,
mtime_t ts )
{
- decoder_sys_t *p_sys = p_subpic->updater.p_sys->p_dec_sys;
+ kate_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
+ decoder_sys_t *p_sys = p_spusys->p_dec_sys;
plane_t *p_plane;
kate_float t;
int i_ret;
/* time in seconds from the start of the stream */
- t = (p_subpic->updater.p_sys->i_start + ts - p_subpic->i_start ) / 1000000.0f;
+ t = (p_spusys->i_start + ts - p_subpic->i_start ) / 1000000.0f;
PROFILE_START( TigerUpdateSubpicture );
@@ -1060,7 +1063,7 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
/* we have an event */
/* Get a new spu */
- subpicture_updater_sys_t *p_spu_sys = NULL;
+ kate_spu_updater_sys_t *p_spu_sys = NULL;
if( p_sys->b_use_tiger)
{
p_spu_sys = malloc( sizeof(*p_spu_sys) );
diff --git a/modules/codec/libass.c b/modules/codec/libass.c
index d1dc6ff51f..9e3a963001 100644
--- a/modules/codec/libass.c
+++ b/modules/codec/libass.c
@@ -102,7 +102,7 @@ static void SubpictureUpdate( subpicture_t *,
mtime_t );
static void SubpictureDestroy( subpicture_t * );
-struct subpicture_updater_sys_t
+typedef struct
{
decoder_sys_t *p_dec_sys;
void *p_subs_data;
@@ -110,7 +110,7 @@ struct subpicture_updater_sys_t
mtime_t i_pts;
ASS_Image *p_img;
-};
+} libass_spu_updater_sys_t;
typedef struct
{
@@ -351,7 +351,7 @@ static int DecodeBlock( decoder_t *p_dec, block_t *p_block )
return VLCDEC_SUCCESS;
}
- subpicture_updater_sys_t *p_spu_sys = malloc( sizeof(*p_spu_sys) );
+ libass_spu_updater_sys_t *p_spu_sys = malloc( sizeof(*p_spu_sys) );
if( !p_spu_sys )
{
block_Release( p_block );
@@ -418,7 +418,8 @@ static int SubpictureValidate( subpicture_t *p_subpic,
bool b_fmt_dst, const video_format_t *p_fmt_dst,
mtime_t i_ts )
{
- decoder_sys_t *p_sys = p_subpic->updater.p_sys->p_dec_sys;
+ libass_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
+ decoder_sys_t *p_sys = p_spusys->p_dec_sys;
vlc_mutex_lock( &p_sys->lock );
@@ -437,7 +438,7 @@ static int SubpictureValidate( subpicture_t *p_subpic,
}
/* */
- const mtime_t i_stream_date = p_subpic->updater.p_sys->i_pts + (i_ts - p_subpic->i_start);
+ const mtime_t i_stream_date = p_spusys->i_pts + (i_ts - p_subpic->i_start);
int i_changed;
ASS_Image *p_img = ass_render_frame( p_sys->p_renderer, p_sys->p_track,
i_stream_date/1000, &i_changed );
@@ -448,7 +449,7 @@ static int SubpictureValidate( subpicture_t *p_subpic,
vlc_mutex_unlock( &p_sys->lock );
return VLC_SUCCESS;
}
- p_subpic->updater.p_sys->p_img = p_img;
+ p_spusys->p_img = p_img;
/* The lock is released by SubpictureUpdate */
return VLC_EGENERIC;
@@ -461,10 +462,11 @@ static void SubpictureUpdate( subpicture_t *p_subpic,
{
VLC_UNUSED( p_fmt_src ); VLC_UNUSED( p_fmt_dst ); VLC_UNUSED( i_ts );
- decoder_sys_t *p_sys = p_subpic->updater.p_sys->p_dec_sys;
+ libass_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
+ decoder_sys_t *p_sys = p_spusys->p_dec_sys;
video_format_t fmt = p_sys->fmt;
- ASS_Image *p_img = p_subpic->updater.p_sys->p_img;
+ ASS_Image *p_img = p_spusys->p_img;
/* */
p_subpic->i_original_picture_height = fmt.i_visible_height;
@@ -520,11 +522,11 @@ static void SubpictureUpdate( subpicture_t *p_subpic,
}
static void SubpictureDestroy( subpicture_t *p_subpic )
{
- subpicture_updater_sys_t *p_sys = p_subpic->updater.p_sys;
+ libass_spu_updater_sys_t *p_spusys = p_subpic->updater.p_sys;
- DecSysRelease( p_sys->p_dec_sys );
- free( p_sys->p_subs_data );
- free( p_sys );
+ DecSysRelease( p_spusys->p_dec_sys );
+ free( p_spusys->p_subs_data );
+ free( p_spusys );
}
static rectangle_t r_create( int x0, int y0, int x1, int y1 )
diff --git a/modules/codec/scte18.c b/modules/codec/scte18.c
index bf4c623087..d184b33525 100644
--- a/modules/codec/scte18.c
+++ b/modules/codec/scte18.c
@@ -186,7 +186,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
p_spu = decoder_NewSubpictureText( p_dec );
if( p_spu )
{
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
p_spu->i_start = p_block->i_pts;
if( p_cea->alert_message_time_remaining )
diff --git a/modules/codec/stl.c b/modules/codec/stl.c
index 25ba6944f4..56e9d96bb2 100644
--- a/modules/codec/stl.c
+++ b/modules/codec/stl.c
@@ -332,7 +332,7 @@ static bool ParseTTI(stl_sg_t *p_group, const uint8_t *p_data, const char *psz_c
return false;
}
-static void FillSubpictureUpdater(stl_sg_t *p_group, subpicture_updater_sys_t *p_spu_sys)
+static void FillSubpictureUpdater(stl_sg_t *p_group, subtext_updater_sys_t *p_spu_sys)
{
if(p_group->i_accumulating)
{
diff --git a/modules/codec/subsdec.c b/modules/codec/subsdec.c
index 48ee15fb94..69bfc3ba1b 100644
--- a/modules/codec/subsdec.c
+++ b/modules/codec/subsdec.c
@@ -459,7 +459,7 @@ static subpicture_t *ParseText( decoder_t *p_dec, block_t *p_block )
p_spu->b_ephemer = (p_block->i_length == 0);
p_spu->b_absolute = false;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
p_spu_sys->region.align = SUBPICTURE_ALIGN_BOTTOM | p_sys->i_align;
p_spu_sys->region.inner_align = SUBPICTURE_ALIGN_BOTTOM;
diff --git a/modules/codec/substext.h b/modules/codec/substext.h
index 600e72cdf8..d71e2f3acf 100644
--- a/modules/codec/substext.h
+++ b/modules/codec/substext.h
@@ -54,8 +54,8 @@ struct substext_updater_region_t
substext_updater_region_t *p_next;
};
-struct subpicture_updater_sys_t {
-
+typedef struct
+{
/* a min of one region */
substext_updater_region_t region;
@@ -64,7 +64,7 @@ struct subpicture_updater_sys_t {
float margin_ratio;
mtime_t i_next_update;
bool b_blink_even;
-};
+} subtext_updater_sys_t;
static inline void SubpictureUpdaterSysRegionClean(substext_updater_region_t *p_updtregion)
{
@@ -100,7 +100,7 @@ static int SubpictureTextValidate(subpicture_t *subpic,
bool has_dst_changed, const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ subtext_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src); VLC_UNUSED(fmt_dst);
if (!has_src_changed && !has_dst_changed &&
@@ -131,7 +131,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ subtext_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src);
if (fmt_dst->i_sar_num <= 0 || fmt_dst->i_sar_den <= 0)
@@ -267,7 +267,7 @@ static void SubpictureTextUpdate(subpicture_t *subpic,
}
static void SubpictureTextDestroy(subpicture_t *subpic)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ subtext_updater_sys_t *sys = subpic->updater.p_sys;
SubpictureUpdaterSysRegionClean( &sys->region );
substext_updater_region_t *p_region = sys->region.p_next;
@@ -284,7 +284,7 @@ static void SubpictureTextDestroy(subpicture_t *subpic)
static inline subpicture_t *decoder_NewSubpictureText(decoder_t *decoder)
{
- subpicture_updater_sys_t *sys = calloc(1, sizeof(*sys));
+ subtext_updater_sys_t *sys = calloc(1, sizeof(*sys));
subpicture_updater_t updater = {
.pf_validate = SubpictureTextValidate,
.pf_update = SubpictureTextUpdate,
diff --git a/modules/codec/substx3g.c b/modules/codec/substx3g.c
index 9dfc718fbf..df49395f9e 100644
--- a/modules/codec/substx3g.c
+++ b/modules/codec/substx3g.c
@@ -357,7 +357,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
return VLCDEC_SUCCESS;
}
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
const text_style_t *p_root_style = (text_style_t *) p_dec->p_sys;
mp4_box_iterator_t it;
diff --git a/modules/codec/textst.c b/modules/codec/textst.c
index 0c2c2a1d01..10ac940726 100644
--- a/modules/codec/textst.c
+++ b/modules/codec/textst.c
@@ -245,8 +245,9 @@ static int Decode(decoder_t *p_dec, block_t *p_block)
p_sub->i_start = p_block->i_dts;
}
+ subtext_updater_sys_t *p_spusys = p_sub->updater.p_sys;
textst_FillRegions(p_dec, &p_block->p_buffer[13], p_block->i_buffer - 13,
- &p_sub->updater.p_sys->region);
+ &p_spusys->region);
p_sub->b_absolute = false;
decoder_QueueSub(p_dec, p_sub);
diff --git a/modules/codec/ttml/substtml.c b/modules/codec/ttml/substtml.c
index fd2af09467..070daf8a14 100644
--- a/modules/codec/ttml/substtml.c
+++ b/modules/codec/ttml/substtml.c
@@ -1105,7 +1105,7 @@ static int ParseBlock( decoder_t *p_dec, const block_t *p_block )
p_spu->b_ephemer = true;
p_spu->b_absolute = true;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
substext_updater_region_t *p_updtregion = NULL;
decoder_sys_t *p_dec_sys = p_dec->p_sys;
diff --git a/modules/codec/webvtt/subsvtt.c b/modules/codec/webvtt/subsvtt.c
index 3dba7e4e7e..54b5dd223a 100644
--- a/modules/codec/webvtt/subsvtt.c
+++ b/modules/codec/webvtt/subsvtt.c
@@ -1651,7 +1651,10 @@ static void CreateSpuOrNewUpdaterRegion( decoder_t *p_dec,
{
*pp_spu = decoder_NewSubpictureText( p_dec );
if( *pp_spu )
- *pp_updtregion = &(*pp_spu)->updater.p_sys->region;
+ {
+ subtext_updater_sys_t *p_spusys = (*pp_spu)->updater.p_sys;
+ *pp_updtregion = &p_spusys->region;
+ }
}
else
{
@@ -1830,7 +1833,7 @@ static void RenderRegions( decoder_t *p_dec, mtime_t i_start, mtime_t i_stop )
p_spu->b_ephemer = true; /* !important */
p_spu->b_absolute = false; /* can't be absolute as snap to lines can overlap ! */
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
p_spu_sys->p_default_style->f_font_relsize = WEBVTT_DEFAULT_LINE_HEIGHT_VH /
WEBVTT_LINE_TO_HEIGHT_RATIO;
decoder_QueueSub( p_dec, p_spu );
diff --git a/modules/codec/zvbi.c b/modules/codec/zvbi.c
index 7215fab33c..4c5147df42 100644
--- a/modules/codec/zvbi.c
+++ b/modules/codec/zvbi.c
@@ -399,7 +399,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
i_align, p_block->i_pts );
if( !p_spu )
goto error;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
p_spu_sys->region.p_segments = text_segment_New("");
p_sys->b_update = true;
@@ -456,7 +456,7 @@ static int Decode( decoder_t *p_dec, block_t *p_block )
while( offset < i_total && isspace( p_text[offset] ) )
offset++;
- subpicture_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
+ subtext_updater_sys_t *p_spu_sys = p_spu->updater.p_sys;
p_spu_sys->region.p_segments = text_segment_New( &p_text[offset] );
if( p_spu_sys->region.p_segments && b_opaque )
{
diff --git a/modules/spu/subsdelay.c b/modules/spu/subsdelay.c
index fced831e13..33fc9bb111 100644
--- a/modules/spu/subsdelay.c
+++ b/modules/spu/subsdelay.c
@@ -114,9 +114,9 @@ static const char * const ppsz_mode_descriptions[] = { N_( "Absolute delay" ), N
* subsdelay_heap_entry_t: Heap entry
*****************************************************************************/
-typedef subpicture_updater_sys_t subsdelay_heap_entry_t;
+typedef struct subsdelay_heap_entry_t subsdelay_heap_entry_t;
-struct subpicture_updater_sys_t
+struct subsdelay_heap_entry_t
{
subpicture_t *p_subpic; /* local subtitle */
diff --git a/src/video_output/video_epg.c b/src/video_output/video_epg.c
index 39a00bf0bd..5f9bac4f04 100644
--- a/src/video_output/video_epg.c
+++ b/src/video_output/video_epg.c
@@ -66,13 +66,13 @@
#define RGB_COLOR1 0x2badde
#define ARGB_BGCOLOR 0xc003182d
-struct subpicture_updater_sys_t
+typedef struct
{
vlc_epg_t *epg;
int64_t time;
char *art;
vlc_object_t *obj;
-};
+} epg_spu_updater_sys_t;
static char * GetDefaultArtUri( void )
{
@@ -316,7 +316,7 @@ static subpicture_region_t * vout_OSDEpgEvent(const vlc_epg_event_t *p_evt,
return vout_OSDTextRegion(p_segment, x, y);
}
-static void vout_FillRightPanel(subpicture_updater_sys_t *p_sys,
+static void vout_FillRightPanel(epg_spu_updater_sys_t *p_sys,
int x, int y,
int width, int height,
int rx, int ry,
@@ -410,7 +410,7 @@ static void vout_FillRightPanel(subpicture_updater_sys_t *p_sys,
}
}
-static subpicture_region_t * vout_BuildOSDEpg(subpicture_updater_sys_t *p_sys,
+static subpicture_region_t * vout_BuildOSDEpg(epg_spu_updater_sys_t *p_sys,
int x, int y,
int visible_width,
int visible_height)
@@ -515,7 +515,7 @@ static void OSDEpgUpdate(subpicture_t *subpic,
const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ epg_spu_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
video_format_t fmt = *fmt_dst;
@@ -535,7 +535,7 @@ static void OSDEpgUpdate(subpicture_t *subpic,
static void OSDEpgDestroy(subpicture_t *subpic)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ epg_spu_updater_sys_t *sys = subpic->updater.p_sys;
if( sys->epg )
vlc_epg_Delete(sys->epg);
free( sys->art );
@@ -617,7 +617,7 @@ int vout_OSDEpg(vout_thread_t *vout, input_item_t *input )
if(epg->psz_name == NULL) /* Fallback (title == channel name) */
epg->psz_name = input_item_GetMeta( input, vlc_meta_Title );
- subpicture_updater_sys_t *sys = malloc(sizeof(*sys));
+ epg_spu_updater_sys_t *sys = malloc(sizeof(*sys));
if (!sys) {
vlc_epg_Delete(epg);
return VLC_EGENERIC;
diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c
index 9a90c9db95..a9e976739a 100644
--- a/src/video_output/video_text.c
+++ b/src/video_output/video_text.c
@@ -31,10 +31,10 @@
#include <vlc_vout.h>
#include <vlc_vout_osd.h>
-struct subpicture_updater_sys_t {
+typedef struct {
int position;
char *text;
-};
+} osd_spu_updater_sys_t;
static int OSDTextValidate(subpicture_t *subpic,
bool has_src_changed, const video_format_t *fmt_src,
@@ -55,7 +55,7 @@ static void OSDTextUpdate(subpicture_t *subpic,
const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ osd_spu_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
if( fmt_dst->i_sar_num <= 0 || fmt_dst->i_sar_den <= 0 )
@@ -102,7 +102,7 @@ static void OSDTextUpdate(subpicture_t *subpic,
static void OSDTextDestroy(subpicture_t *subpic)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ osd_spu_updater_sys_t *sys = subpic->updater.p_sys;
free(sys->text);
free(sys);
@@ -115,7 +115,7 @@ void vout_OSDText(vout_thread_t *vout, int channel,
if (!var_InheritBool(vout, "osd") || duration <= 0)
return;
- subpicture_updater_sys_t *sys = malloc(sizeof(*sys));
+ osd_spu_updater_sys_t *sys = malloc(sizeof(*sys));
if (!sys)
return;
sys->position = position;
diff --git a/src/video_output/video_widgets.c b/src/video_output/video_widgets.c
index 4e7db3990e..95a2bc9d8f 100644
--- a/src/video_output/video_widgets.c
+++ b/src/video_output/video_widgets.c
@@ -243,10 +243,10 @@ static subpicture_region_t *OSDIcon(int type, const video_format_t *fmt)
return r;
}
-struct subpicture_updater_sys_t {
+typedef struct {
int type;
int position;
-};
+} osdwidget_spu_updater_sys_t;
static int OSDWidgetValidate(subpicture_t *subpic,
bool has_src_changed, const video_format_t *fmt_src,
@@ -267,7 +267,7 @@ static void OSDWidgetUpdate(subpicture_t *subpic,
const video_format_t *fmt_dst,
mtime_t ts)
{
- subpicture_updater_sys_t *sys = subpic->updater.p_sys;
+ osdwidget_spu_updater_sys_t *sys = subpic->updater.p_sys;
VLC_UNUSED(fmt_src); VLC_UNUSED(ts);
video_format_t fmt = *fmt_dst;
@@ -297,7 +297,7 @@ static void OSDWidget(vout_thread_t *vout, int channel, int type, int position)
if (type == OSD_HOR_SLIDER || type == OSD_VERT_SLIDER)
position = VLC_CLIP(position, 0, 100);
- subpicture_updater_sys_t *sys = malloc(sizeof(*sys));
+ osdwidget_spu_updater_sys_t *sys = malloc(sizeof(*sys));
if (!sys)
return;
sys->type = type;
More information about the vlc-commits
mailing list