[vlc-commits] a52: check if PTS is valid
Rémi Denis-Courmont
git at videolan.org
Sun Nov 12 14:25:40 CET 2017
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 12 13:24:45 2017 +0200| [797e716605ea3e41c731d0ff968ed219a0284410] | committer: Rémi Denis-Courmont
a52: check if PTS is valid
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=797e716605ea3e41c731d0ff968ed219a0284410
---
modules/packetizer/a52.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/packetizer/a52.c b/modules/packetizer/a52.c
index 8f6b840cdd..cc3cea6bad 100644
--- a/modules/packetizer/a52.c
+++ b/modules/packetizer/a52.c
@@ -30,6 +30,8 @@
# include "config.h"
#endif
+#include <assert.h>
+
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
@@ -88,13 +90,18 @@ static block_t *GetOutBuffer( decoder_t *p_dec )
if( date_Get( &p_sys->end_date ) == VLC_TS_INVALID
|| p_dec->fmt_out.audio.i_rate != p_sys->frame.i_rate )
{
+ if( p_sys->i_pts == VLC_TS_INVALID )
+ return NULL;
+
msg_Dbg( p_dec, "A/52 channels:%d samplerate:%d bitrate:%d",
p_sys->frame.i_channels, p_sys->frame.i_rate, p_sys->frame.i_bitrate );
+ assert( p_sys->frame.i_rate > 0 );
date_Init( &p_sys->end_date, p_sys->frame.i_rate, 1 );
date_Set( &p_sys->end_date, p_sys->i_pts );
}
+ assert( p_sys->i_pts > VLC_TS_INVALID );
p_dec->fmt_out.audio.i_rate = p_sys->frame.i_rate;
p_dec->fmt_out.audio.i_channels = p_sys->frame.i_channels;
if( p_dec->fmt_out.audio.i_bytes_per_frame < p_sys->frame.i_size )
More information about the vlc-commits
mailing list