Commit 2b648b82 authored by Laurent Aimar's avatar Laurent Aimar

ALL : In order to make ac3 working in avi file, I've deplaced some code

from ac3 decoder to mpeg_system.c. ( skip 3 bytes is now done in
mpeg_system.c and no longer in ac3 audio decoder ).
parent d2ff612b
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* (http://liba52.sf.net/). * (http://liba52.sf.net/).
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: a52.c,v 1.12 2002/05/24 12:42:14 gbazin Exp $ * $Id: a52.c,v 1.13 2002/05/27 16:01:42 fenrir Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -367,6 +367,6 @@ static void BitstreamCallback ( bit_stream_t * p_bit_stream, ...@@ -367,6 +367,6 @@ static void BitstreamCallback ( bit_stream_t * p_bit_stream,
if( b_new_pes ) if( b_new_pes )
{ {
/* Drop special AC3 header */ /* Drop special AC3 header */
p_bit_stream->p_byte += 3; /* p_bit_stream->p_byte += 3; */
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_adec.c: ac3 decoder module main file * ac3_adec.c: ac3 decoder module main file
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: ac3_adec.c,v 1.30 2002/05/15 19:36:04 sam Exp $ * $Id: ac3_adec.c,v 1.31 2002/05/27 16:01:42 fenrir Exp $
* *
* Authors: Michel Lespinasse <walken@zoy.org> * Authors: Michel Lespinasse <walken@zoy.org>
* *
...@@ -428,7 +428,7 @@ static void BitstreamCallback ( bit_stream_t * p_bit_stream, ...@@ -428,7 +428,7 @@ static void BitstreamCallback ( bit_stream_t * p_bit_stream,
if( b_new_pes ) if( b_new_pes )
{ {
/* Drop special AC3 header */ /* Drop special AC3 header */
p_bit_stream->p_byte += 3; /* p_bit_stream->p_byte += 3; */
} }
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard * ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.25 2002/05/24 12:42:14 gbazin Exp $ * $Id: ac3_spdif.c,v 1.26 2002/05/27 16:01:42 fenrir Exp $
* *
* Authors: Stphane Borel <stef@via.ecp.fr> * Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi> * Juha Yrjola <jyrjola@cc.hut.fi>
...@@ -385,7 +385,7 @@ static void BitstreamCallback( bit_stream_t * p_bit_stream, ...@@ -385,7 +385,7 @@ static void BitstreamCallback( bit_stream_t * p_bit_stream,
{ {
p_spdif = (ac3_spdif_thread_t *)p_bit_stream->p_callback_arg; p_spdif = (ac3_spdif_thread_t *)p_bit_stream->p_callback_arg;
p_bit_stream->p_byte += 3; /* p_bit_stream->p_byte += 3; */
p_spdif->i_pts = p_spdif->i_pts =
p_bit_stream->p_decoder_fifo->p_first->i_pts; p_bit_stream->p_decoder_fifo->p_first->i_pts;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management * mpeg_system.c: TS, PS and PES management
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: mpeg_system.c,v 1.96 2002/05/18 17:47:47 sam Exp $ * $Id: mpeg_system.c,v 1.97 2002/05/27 16:01:42 fenrir Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr> * Michel Lespinasse <walken@via.ecp.fr>
...@@ -340,6 +340,12 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -340,6 +340,12 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
i_pes_header_size++; i_pes_header_size++;
} }
if( p_es->i_type == AC3_AUDIO_ES )
{
/* With ac3 audio, we need to skip first 3 bytes */
i_pes_header_size += 3;
}
/* Now we've parsed the header, we just have to indicate in some /* Now we've parsed the header, we just have to indicate in some
* specific data packets where the PES payload begins (renumber * specific data packets where the PES payload begins (renumber
* p_payload_start), so that the decoders can find the beginning * p_payload_start), so that the decoders can find the beginning
...@@ -373,6 +379,7 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es ) ...@@ -373,6 +379,7 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
} }
p_data->p_payload_start += i_pes_header_size; p_data->p_payload_start += i_pes_header_size;
/* Now we can eventually put the PES packet in the decoder's /* Now we can eventually put the PES packet in the decoder's
* PES fifo */ * PES fifo */
if( p_es->p_decoder_fifo != NULL ) if( p_es->p_decoder_fifo != NULL )
......
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