Commit 68416d1a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

DTS in wav: use DTS helper

parent 108edbd9
......@@ -195,11 +195,9 @@ int GetSyncInfo( const uint8_t *p_buf,
pi_bit_rate, pi_frame_length );
}
/* DTS-HD */
else
else if( p_buf[0] == 0x64 && p_buf[1] == 0x58 &&
p_buf[2] == 0x20 && p_buf[3] == 0x25 )
{
assert( p_buf[0] == 0x64 && p_buf[1] == 0x58 &&
p_buf[2] == 0x20 && p_buf[3] == 0x25 );
int i_dts_hd_size;
bs_t s;
bs_init( &s, &p_buf[4], DTS_HEADER_SIZE - 4 );
......@@ -230,6 +228,10 @@ int GetSyncInfo( const uint8_t *p_buf,
*/
return i_dts_hd_size;
}
else
{
return VLC_EGENERIC;
}
*pb_dts_hd = false;
return i_frame_size;
......
......@@ -65,7 +65,7 @@ endif
libvlc_LTLIBRARIES += $(LTLIBavformat)
EXTRA_LTLIBRARIES += libavformat_plugin.la
libes_plugin_la_SOURCES = mpeg/es.c
libes_plugin_la_SOURCES = mpeg/es.c ../codec/dts_header.c ../codec/dts_header.h ../codec/a52.h
libes_plugin_la_CFLAGS = $(AM_CFLAGS)
libes_plugin_la_LIBADD = $(AM_LIBADD)
......
......@@ -38,6 +38,7 @@
#include <vlc_input.h>
#include "../../codec/a52.h"
#include "../../codec/dts_header.h"
/*****************************************************************************
* Module descriptor
......@@ -920,36 +921,7 @@ static int A52Init( demux_t *p_demux )
static int DtsCheckSync( const uint8_t *p_peek, int *pi_samples )
{
/* TODO return frame size for robustness */
/* 14 bits, little endian version of the bitstream */
if( p_peek[0] == 0xff && p_peek[1] == 0x1f &&
p_peek[2] == 0x00 && p_peek[3] == 0xe8 &&
(p_peek[4] & 0xf0) == 0xf0 && p_peek[5] == 0x07 )
{
return 0;
}
/* 14 bits, big endian version of the bitstream */
else if( p_peek[0] == 0x1f && p_peek[1] == 0xff &&
p_peek[2] == 0xe8 && p_peek[3] == 0x00 &&
p_peek[4] == 0x07 && (p_peek[5] & 0xf0) == 0xf0)
{
return 0;
}
/* 16 bits, big endian version of the bitstream */
else if( p_peek[0] == 0x7f && p_peek[1] == 0xfe &&
p_peek[2] == 0x80 && p_peek[3] == 0x01 )
{
return 0;
}
/* 16 bits, little endian version of the bitstream */
else if( p_peek[0] == 0xfe && p_peek[1] == 0x7f &&
p_peek[2] == 0x01 && p_peek[3] == 0x80 )
{
return 0;
}
VLC_UNUSED(pi_samples);
return VLC_EGENERIC;
return SyncCode( p_peek );
}
static int DtsProbe( demux_t *p_demux, int64_t *pi_offset )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment