summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoachim Koenig <joachim_koenig@users.sourceforge.net>2001-05-30 18:33:01 +0000
committerJoachim Koenig <joachim_koenig@users.sourceforge.net>2001-05-30 18:33:01 +0000
commit29a0b759ed5dcc9c0556055b78eea7ddf71b9f2f (patch)
treeefeca840711500a2e3ebedb8f292b51300cb36b8 /src
parent496436c7187f3e77c2c0a1ff419f28b5265fc814 (diff)
downloadxine-lib-29a0b759ed5dcc9c0556055b78eea7ddf71b9f2f.tar.gz
xine-lib-29a0b759ed5dcc9c0556055b78eea7ddf71b9f2f.tar.bz2
AC3 looptrougth changes
CVS patchset: 105 CVS date: 2001/05/30 18:33:01
Diffstat (limited to 'src')
-rw-r--r--src/libac3/xine_decoder.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/libac3/xine_decoder.c b/src/libac3/xine_decoder.c
index 29927cee5..c4c286070 100644
--- a/src/libac3/xine_decoder.c
+++ b/src/libac3/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.6 2001/05/28 22:00:46 guenter Exp $
+ * $Id: xine_decoder.c,v 1.7 2001/05/30 18:33:01 joachim_koenig Exp $
*
* stuff needed to turn libac3 into a xine decoder plugin
*/
@@ -42,6 +42,7 @@ typedef struct ac3dec_decoder_s {
uint32_t pts;
uint8_t frame_buffer[FRAME_SIZE];
+ uint16_t ac3_buffer[4 * 6 * 256];
uint8_t *frame_ptr;
int sync_todo;
int frame_length, frame_todo;
@@ -220,11 +221,21 @@ void ac3dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->output_mode = AO_CAP_MODE_AC3;
}
+ this->ac3_buffer[0] = 0xf872; //spdif syncword
+ this->ac3_buffer[1] = 0x4e1f; // .............
+ this->ac3_buffer[2] = 0x0001; // AC3 data
+ this->ac3_buffer[3] = this->frame_length * 16;
+ this->ac3_buffer[4] = 0x0b77; // AC3 syncwork
+
+ // ac3 seems to be swabbed data
+ swab(this->frame_buffer,&this->ac3_buffer[5], this->frame_length * 2 );
+
+
if (this->output_open) {
this->audio_out->write_audio_data (this->audio_out,
- (int16_t*)this->frame_buffer,
- this->frame_length,
+ (int16_t*)this->ac3_buffer,
+ 6 * 256,
this->pts);
this->pts = 0;
}