Commit 36def779 authored by Laurent Aimar's avatar Laurent Aimar

Fixed (partially) parsing of E-AC3 not using 1536 samples per frame.

parent 029138a0
...@@ -359,7 +359,7 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer ) ...@@ -359,7 +359,7 @@ static uint8_t *GetOutBuffer( decoder_t *p_dec, void **pp_out_buffer )
p_dec->fmt_out.audio.i_channels = p_sys->frame.i_channels; 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 ) if( p_dec->fmt_out.audio.i_bytes_per_frame < p_sys->frame.i_size )
p_dec->fmt_out.audio.i_bytes_per_frame = p_sys->frame.i_size; p_dec->fmt_out.audio.i_bytes_per_frame = p_sys->frame.i_size;
p_dec->fmt_out.audio.i_frame_length = A52_FRAME_NB; p_dec->fmt_out.audio.i_frame_length = p_sys->frame.i_samples;
p_dec->fmt_out.audio.i_original_channels = p_sys->frame.i_channels_conf; p_dec->fmt_out.audio.i_original_channels = p_sys->frame.i_channels_conf;
p_dec->fmt_out.audio.i_physical_channels = p_dec->fmt_out.audio.i_physical_channels =
...@@ -391,11 +391,11 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec ) ...@@ -391,11 +391,11 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
decoder_sys_t *p_sys = p_dec->p_sys; decoder_sys_t *p_sys = p_dec->p_sys;
aout_buffer_t *p_buf; aout_buffer_t *p_buf;
p_buf = decoder_NewAudioBuffer( p_dec, A52_FRAME_NB ); p_buf = decoder_NewAudioBuffer( p_dec, p_sys->frame.i_samples );
if( p_buf == NULL ) return NULL; if( p_buf == NULL ) return NULL;
p_buf->start_date = aout_DateGet( &p_sys->end_date ); p_buf->start_date = aout_DateGet( &p_sys->end_date );
p_buf->end_date = aout_DateIncrement( &p_sys->end_date, A52_FRAME_NB ); p_buf->end_date = aout_DateIncrement( &p_sys->end_date, p_sys->frame.i_samples );
return p_buf; return p_buf;
} }
...@@ -414,7 +414,7 @@ static block_t *GetSoutBuffer( decoder_t *p_dec ) ...@@ -414,7 +414,7 @@ static block_t *GetSoutBuffer( decoder_t *p_dec )
p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date ); p_block->i_pts = p_block->i_dts = aout_DateGet( &p_sys->end_date );
p_block->i_length = p_block->i_length =
aout_DateIncrement( &p_sys->end_date, A52_FRAME_NB ) - p_block->i_pts; aout_DateIncrement( &p_sys->end_date, p_sys->frame.i_samples ) - p_block->i_pts;
return p_block; return p_block;
} }
......
...@@ -54,6 +54,7 @@ typedef struct ...@@ -54,6 +54,7 @@ typedef struct
unsigned int i_bitrate; unsigned int i_bitrate;
unsigned int i_size; unsigned int i_size;
unsigned int i_samples;
} vlc_a52_header_t; } vlc_a52_header_t;
...@@ -122,6 +123,8 @@ static inline int vlc_a52_header_ParseAc3( vlc_a52_header_t *p_header, ...@@ -122,6 +123,8 @@ static inline int vlc_a52_header_ParseAc3( vlc_a52_header_t *p_header,
default: default:
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_header->i_samples = 6*256;
p_header->b_eac3 = false; p_header->b_eac3 = false;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -170,6 +173,7 @@ static inline int vlc_a52_header_ParseEac3( vlc_a52_header_t *p_header, ...@@ -170,6 +173,7 @@ static inline int vlc_a52_header_ParseEac3( vlc_a52_header_t *p_header,
p_header->i_channels = p_acmod[i_acmod].i_count + i_lfeon; p_header->i_channels = p_acmod[i_acmod].i_count + i_lfeon;
p_header->i_channels_conf = p_acmod[i_acmod].i_configuration | ( i_lfeon ? AOUT_CHAN_LFE : 0); p_header->i_channels_conf = p_acmod[i_acmod].i_configuration | ( i_lfeon ? AOUT_CHAN_LFE : 0);
p_header->i_bitrate = 8 * p_header->i_size * (p_header->i_rate) / (i_numblkscod * 256); p_header->i_bitrate = 8 * p_header->i_size * (p_header->i_rate) / (i_numblkscod * 256);
p_header->i_samples = i_numblkscod * 256;
p_header->b_eac3 = true; p_header->b_eac3 = true;
return VLC_SUCCESS; return VLC_SUCCESS;
......
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