comparison libmpcodecs/ad_a52.c @ 5458:b3d1348b251f

audio input buffer allocation/free cleanup
author arpi
date Mon, 01 Apr 2002 17:58:04 +0000
parents 3dd532400d44
children 1e47c2e7aa8e
comparison
equal deleted inserted replaced
5457:f248c9e86423 5458:b3d1348b251f
94 static int preinit(sh_audio_t *sh) 94 static int preinit(sh_audio_t *sh)
95 { 95 {
96 /* Dolby AC3 audio: */ 96 /* Dolby AC3 audio: */
97 /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */ 97 /* however many channels, 2 bytes in a word, 256 samples in a block, 6 blocks in a frame */
98 sh->audio_out_minsize=audio_output_channels*2*256*6; 98 sh->audio_out_minsize=audio_output_channels*2*256*6;
99 sh->audio_in_minsize=3840;
99 return 1; 100 return 1;
100 } 101 }
101 102
102 static int init(sh_audio_t *sh_audio) 103 static int init(sh_audio_t *sh_audio)
103 { 104 {
113 a52_samples=a52_init (a52_accel); 114 a52_samples=a52_init (a52_accel);
114 if (a52_samples == NULL) { 115 if (a52_samples == NULL) {
115 mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 init failed\n"); 116 mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 init failed\n");
116 return 0; 117 return 0;
117 } 118 }
118 sh_audio->a_in_buffer_size=3840;
119 sh_audio->a_in_buffer=malloc(sh_audio->a_in_buffer_size);
120 sh_audio->a_in_buffer_len=0;
121 if(a52_fillbuff(sh_audio)<0){ 119 if(a52_fillbuff(sh_audio)<0){
122 mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 sync failed\n"); 120 mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 sync failed\n");
123 return 0; 121 return 0;
124 } 122 }
125 /* 'a52 cannot upmix' hotfix:*/ 123 /* 'a52 cannot upmix' hotfix:*/