annotate libmpcodecs/ad_ffmpeg.c @ 8528:9d143176d95f

XMMS Input plugin support based on patches by Balatoni Denes <pnis@coder.hu> changes by me: glib dependency removed, files merged, code simplified, some bugfixes
author arpi
date Sun, 22 Dec 2002 21:01:01 +0000
parents d9b2b39e5c06
children 0328af0565bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
1 #include <stdio.h>
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
2 #include <stdlib.h>
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
3 #include <unistd.h>
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
4
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
5 #include "config.h"
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
6 #include "mp_msg.h"
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
7 #include "help_mp.h"
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
8
5343
3dd532400d44 argh... Nick messed up driver names too
arpi
parents: 5340
diff changeset
9 #ifdef USE_LIBAVCODEC
3dd532400d44 argh... Nick messed up driver names too
arpi
parents: 5340
diff changeset
10
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
11 #include "ad_internal.h"
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
12
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
13 #include "bswap.h"
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
14
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
15 static ad_info_t info =
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
16 {
7191
1eadce15446c -afm/-vfm help implemenetd, some cosmetics of ad/vd codec names/comments
arpi
parents: 7180
diff changeset
17 "FFmpeg/libavcodec audio decoders",
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
18 "ffmpeg",
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
19 "Nick Kurshev",
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
20 "ffmpeg.sf.net",
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
21 ""
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
22 };
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
23
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
24 LIBAD_EXTERN(ffmpeg)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
25
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
26 #define assert(x)
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
27
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
28 #ifdef USE_LIBAVCODEC_SO
7004
8eff71f38685 dynamic libavcodec.so support updated by
arpi
parents: 5480
diff changeset
29 #include <ffmpeg/avcodec.h>
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
30 #else
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
31 #include "libavcodec/avcodec.h"
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
32 #endif
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
33
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
34 extern int avcodec_inited;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
35
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
36 static int preinit(sh_audio_t *sh)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
37 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
38 sh->audio_out_minsize=AVCODEC_MAX_AUDIO_FRAME_SIZE;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
39 return 1;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
40 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
41
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
42 static int init(sh_audio_t *sh_audio)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
43 {
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
44 int x;
5480
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
45 AVCodecContext *lavc_context;
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
46 AVCodec *lavc_codec;
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
47
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
48 mp_msg(MSGT_DECAUDIO,MSGL_V,"FFmpeg's libavcodec audio codec\n");
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
49 if(!avcodec_inited){
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
50 avcodec_init();
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
51 avcodec_register_all();
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
52 avcodec_inited=1;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
53 }
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
54
5480
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
55 lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh_audio->codec->dll);
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
56 if(!lavc_codec){
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
57 mp_msg(MSGT_DECAUDIO,MSGL_ERR,MSGTR_MissingLAVCcodec,sh_audio->codec->dll);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
58 return 0;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
59 }
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
60
7940
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
61 lavc_context = avcodec_alloc_context();
5480
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
62 sh_audio->context=lavc_context;
7940
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
63
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
64 lavc_context->channels = sh_audio->wf->nChannels;
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
65 lavc_context->sample_rate = sh_audio->wf->nSamplesPerSec;
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
66 lavc_context->bit_rate = sh_audio->wf->nAvgBytesPerSec * 8;
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
67 lavc_context->fourcc = sh_audio->format;
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
68 lavc_context->block_align = sh_audio->wf->nBlockAlign;
7958
2a5def1e08d7 10l - fixed wma version misdetection
alex
parents: 7940
diff changeset
69 lavc_context->codec_id = lavc_codec->id;
7940
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
70
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
71 /* alloc extra data */
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
72 if (sh_audio->wf->cbSize > 0) {
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
73 lavc_context->extradata = malloc(sh_audio->wf->cbSize);
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
74 lavc_context->extradata_size = sh_audio->wf->cbSize;
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
75 memcpy(lavc_context->extradata, (char *)sh_audio->wf + sizeof(WAVEFORMATEX),
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
76 lavc_context->extradata_size);
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
77 }
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
78
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
79 /* open it */
5480
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
80 if (avcodec_open(lavc_context, lavc_codec) < 0) {
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
81 mp_msg(MSGT_DECAUDIO,MSGL_ERR, MSGTR_CantOpenCodec);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
82 return 0;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
83 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
84 mp_msg(MSGT_DECAUDIO,MSGL_V,"INFO: libavcodec init OK!\n");
8101
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
85
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
86 // printf("\nFOURCC: 0x%X\n",sh_audio->format);
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
87 if(sh_audio->format==0x3343414D){
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
88 // MACE 3:1
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
89 sh_audio->ds->ss_div = 2*3; // 1 samples/packet
8108
d9b2b39e5c06 Fix stereo MACE files
rtognimp
parents: 8101
diff changeset
90 sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet
8101
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
91 } else
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
92 if(sh_audio->format==0x3643414D){
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
93 // MACE 6:1
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
94 sh_audio->ds->ss_div = 2*6; // 1 samples/packet
8108
d9b2b39e5c06 Fix stereo MACE files
rtognimp
parents: 8101
diff changeset
95 sh_audio->ds->ss_mul = 2*sh_audio->wf->nChannels; // 1 byte*ch/packet
8101
1bce6e325946 MACE fix
arpi
parents: 7958
diff changeset
96 }
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
97
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
98 // Decode at least 1 byte: (to get header filled)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
99 x=decode_audio(sh_audio,sh_audio->a_buffer,1,sh_audio->a_buffer_size);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
100 if(x>0) sh_audio->a_buffer_len=x;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
101
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
102 #if 1
5480
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
103 sh_audio->channels=lavc_context->channels;
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
104 sh_audio->samplerate=lavc_context->sample_rate;
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
105 sh_audio->i_bps=lavc_context->bit_rate/8;
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
106 #else
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
107 sh_audio->channels=sh_audio->wf->nChannels;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
108 sh_audio->samplerate=sh_audio->wf->nSamplesPerSec;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
109 sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
110 #endif
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
111 return 1;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
112 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
113
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
114 static void uninit(sh_audio_t *sh)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
115 {
7940
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
116 AVCodecContext *lavc_context = sh->context;
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
117
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
118 if (avcodec_close(lavc_context) < 0)
5447
63082aa173f8 using sh->context
alex
parents: 5343
diff changeset
119 mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_CantCloseCodec);
7940
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
120 if (lavc_context->extradata)
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
121 free(lavc_context->extradata);
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
122 free(lavc_context);
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
123 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
124
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
125 static int control(sh_audio_t *sh,int cmd,void* arg, ...)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
126 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
127 // TODO ???
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
128 return CONTROL_UNKNOWN;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
129 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
130
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
131 static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
132 {
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
133 unsigned char *start=NULL;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
134 int y,len=-1;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
135 while(len<minlen){
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
136 int len2=0;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
137 int x=ds_get_packet(sh_audio->ds,&start);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
138 if(x<=0) break; // error
5480
df12f6eb80e3 removed useless contect struct -> code simplified
arpi
parents: 5447
diff changeset
139 y=avcodec_decode_audio(sh_audio->context,(INT16*)buf,&len2,start,x);
5340
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
140 if(y<0){ mp_msg(MSGT_DECAUDIO,MSGL_V,"lavc_audio: error\n");break; }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
141 if(y<x) sh_audio->ds->buffer_pos+=y-x; // put back data (HACK!)
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
142 if(len2>0){
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
143 //len=len2;break;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
144 if(len<0) len=len2; else len+=len2;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
145 buf+=len2;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
146 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
147 mp_dbg(MSGT_DECAUDIO,MSGL_DBG2,"Decoded %d -> %d \n",y,len2);
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
148 }
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
149 return len;
0f12fb7c1c5d imported from MPlayerXP, dlopen() hack removed, some bugs fixed, interface functions changed to static, info->author field added
arpi
parents:
diff changeset
150 }
5343
3dd532400d44 argh... Nick messed up driver names too
arpi
parents: 5340
diff changeset
151
3dd532400d44 argh... Nick messed up driver names too
arpi
parents: 5340
diff changeset
152 #endif
7940
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
153
26fd599d4bad pass extradata to the codec
arpi
parents: 7191
diff changeset
154