It avoids loosing subtitles with the messages
"main subpicture error: subpicture heap full".
/* Max acceptable resampling (in %) */
#define AOUT_MAX_RESAMPLING 10
+/*****************************************************************************
+ * SPU configuration
+ *****************************************************************************/
+
+/* Buffer must avoid arriving more than SPU_MAX_PREPARE_TIME in advanced to
+ * the SPU */
+#define SPU_MAX_PREPARE_TIME ((mtime_t)(0.5*CLOCK_FREQ))
+
/*****************************************************************************
* Video configuration
*****************************************************************************/
vlc_mutex_unlock( &p_owner->lock );
+ if( p_subpic->i_start <= VLC_TS_INVALID )
+ b_reject = true;
+
+ DecoderWaitDate( p_dec, &b_reject,
+ p_subpic->i_start - SPU_MAX_PREPARE_TIME );
+
if( !b_reject )
spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_subpic );
else
/*****************************************************************************
* Local prototypes
*****************************************************************************/
+
/* Number of simultaneous subpictures */
-#define VOUT_MAX_SUBPICTURES (VOUT_MAX_PICTURES)
+#define VOUT_MAX_SUBPICTURES (__MAX(VOUT_MAX_PICTURES, SPU_MAX_PREPARE_TIME/5000))
/* */
typedef struct