summaryrefslogtreecommitdiff
path: root/multimedia/libxine/files/patch-src:liba52:xine_decoder.c
blob: 5a1826987a2f36e68a76f0c8beb04730da91d511 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- src/liba52/xine_decoder.c.orig	Sun Apr 28 22:57:28 2002
+++ src/liba52/xine_decoder.c	Thu May 16 22:16:31 2002
@@ -36,8 +36,8 @@
 #include <fcntl.h>
 
 #include "audio_out.h"
-#include "a52.h"
-#include "a52_internal.h"
+#include <a52dec/a52.h>
+#include <a52dec/a52_internal.h>
 #include "buffer.h"
 #include "xine_internal.h"
 #include "xineutils.h"
@@ -58,7 +58,7 @@
   int              frame_length, frame_todo;
   uint16_t         syncword;
 
-  a52_state_t      a52_state;
+  a52_state_t      *a52_state;
   int              a52_flags;
   int              a52_bit_rate;
   int              a52_sample_rate;
@@ -154,8 +154,11 @@
   this->output_open   = 0;
   this->pts           = 0;
 
-  if( !this->samples )
-    this->samples = a52_init (xine_mm_accel(), &this->samples_base);
+  this->a52_state = a52_init (xine_mm_accel());
+
+  if( (this->a52_state) != NULL )
+    if( !this->samples )
+      this->samples = a52_samples (this->a52_state);
 
   /*
    * find out if this driver supports a52 output
@@ -284,7 +287,7 @@
     
     a52_output_flags = this->a52_flags_map[this->a52_flags & A52_CHANNEL_MASK];
     
-    if (a52_frame (&this->a52_state, 
+    if (a52_frame (this->a52_state, 
 		   this->frame_buffer, 
 		   &a52_output_flags,
 		   &level, 384)) {
@@ -293,7 +296,7 @@
     }
     
     if (this->disable_dynrng)
-      a52_dynrng (&this->a52_state, NULL, NULL);
+      a52_dynrng (this->a52_state, NULL, NULL);
 
     this->have_lfe = a52_output_flags & A52_LFE;
     if (this->have_lfe)
@@ -334,7 +337,7 @@
     buf->num_frames = 256*6;
 
     for (i = 0; i < 6; i++) {
-      if (a52_block (&this->a52_state, this->samples)) {
+      if (a52_block (this->a52_state)) {
 	printf ("liba52: a52_block error\n");
 	buf->num_frames = 0;
 	break;