[vlc-commits] DTS in wav: check frame size
Jean-Baptiste Kempf
git at videolan.org
Tue Nov 13 15:14:35 CET 2012
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Nov 12 20:12:05 2012 +0100| [29c4138de9e23575c109999edeefee3f41b81ebc] | committer: Jean-Baptiste Kempf
DTS in wav: check frame size
Close #7282
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=29c4138de9e23575c109999edeefee3f41b81ebc
---
modules/demux/mpeg/es.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/modules/demux/mpeg/es.c b/modules/demux/mpeg/es.c
index 742bd7c..1807d6b 100644
--- a/modules/demux/mpeg/es.c
+++ b/modules/demux/mpeg/es.c
@@ -920,8 +920,22 @@ static int A52Init( demux_t *p_demux )
*****************************************************************************/
static int DtsCheckSync( const uint8_t *p_peek, int *pi_samples )
{
- /* TODO return frame size for robustness */
- return SyncCode( p_peek );
+ unsigned int i_sample_rate, i_bit_rate, i_frame_length, i_audio_mode;
+ bool b_dts_hd;
+
+ VLC_UNUSED(pi_samples);
+
+ int i_frame_size = GetSyncInfo( p_peek,
+ &b_dts_hd,
+ &i_sample_rate,
+ &i_bit_rate,
+ &i_frame_length,
+ &i_audio_mode );
+
+ if( i_frame_size != VLC_EGENERIC && i_frame_size <= 8192 )
+ return VLC_SUCCESS;
+ else
+ return VLC_EGENERIC;
}
static int DtsProbe( demux_t *p_demux, int64_t *pi_offset )
More information about the vlc-commits
mailing list