Mercurial > mplayer.hg
annotate libao2/ao_sun.c @ 1285:202d9e2dc202
-vcodec option (maybe some other name would be better though) to select between driver types without editing codecs.conf. mplayer will default to normal codec search loop if it does not find codec for the specified driver type. config range checking for the parameter (an integer) should be cleaned, IMHO
author | lgb |
---|---|
date | Fri, 06 Jul 2001 21:17:22 +0000 |
parents | 18539f68dd37 |
children | ffd63a75700c |
rev | line source |
---|---|
1041 | 1 #include <stdio.h> |
2 #include <stdlib.h> | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
3 #include <string.h> |
1041 | 4 |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
5 #include <unistd.h> |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
6 #include <fcntl.h> |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
7 #include <errno.h> |
1041 | 8 #include <sys/ioctl.h> |
9 #include <sys/time.h> | |
10 #include <sys/types.h> | |
11 #include <sys/stat.h> | |
12 #include <sys/audioio.h> | |
13 #ifdef __svr4__ | |
14 #include <stropts.h> | |
15 #endif | |
16 | |
17 #include "../config.h" | |
18 | |
19 #include "audio_out.h" | |
20 #include "audio_out_internal.h" | |
1058 | 21 #include "afmt.h" |
1041 | 22 |
23 static ao_info_t info = | |
24 { | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
25 "Sun audio output", |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
26 "sun", |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
27 "jk@tools.de", |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
28 "" |
1041 | 29 }; |
30 | |
31 LIBAO_EXTERN(sun) | |
32 | |
33 | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
34 /* These defines are missing on NetBSD */ |
1041 | 35 #ifndef AUDIO_PRECISION_8 |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
36 #define AUDIO_PRECISION_8 8 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
37 #define AUDIO_PRECISION_16 16 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
38 #endif |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
39 #ifndef AUDIO_CHANNELS_MONO |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
40 #define AUDIO_CHANNELS_MONO 1 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
41 #define AUDIO_CHANNELS_STEREO 2 |
1041 | 42 #endif |
43 | |
44 | |
45 // there are some globals: | |
46 // ao_samplerate | |
47 // ao_channels | |
48 // ao_format | |
49 // ao_bps | |
50 // ao_outburst | |
51 // ao_buffersize | |
52 | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
53 static char *audio_dev = "/dev/audio"; |
1041 | 54 static int queued_bursts = 0; |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
55 static int queued_samples = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
56 static int bytes_per_sample = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
57 static int audio_fd = -1; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
58 static enum { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
59 RTSC_UNKNOWN = 0, |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
60 RTSC_ENABLED, |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
61 RTSC_DISABLED |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
62 } enable_sample_timing; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
63 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
64 extern int verbose; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
65 |
1041 | 66 |
1058 | 67 // convert an OSS audio format specification into a sun audio encoding |
68 static int oss2sunfmt(int oss_format) | |
69 { | |
70 switch (oss_format){ | |
71 case AFMT_MU_LAW: | |
72 return AUDIO_ENCODING_ULAW; | |
73 case AFMT_A_LAW: | |
74 return AUDIO_ENCODING_ALAW; | |
75 case AFMT_S16_LE: | |
76 return AUDIO_ENCODING_LINEAR; | |
77 case AFMT_U8: | |
78 return AUDIO_ENCODING_LINEAR8; | |
79 #ifdef AUDIO_ENCODING_DVI // Missing on NetBSD... | |
80 case AFMT_IMA_ADPCM: | |
81 return AUDIO_ENCODING_DVI; | |
82 #endif | |
83 default: | |
84 return AUDIO_ENCODING_NONE; | |
85 } | |
86 } | |
87 | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
88 // try to figure out, if the soundcard driver provides usable (precise) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
89 // sample counter information |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
90 static int realtime_samplecounter_available(char *dev) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
91 { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
92 int fd = -1; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
93 audio_info_t info; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
94 int rtsc_ok = RTSC_DISABLED; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
95 int len; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
96 void *silence = NULL; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
97 struct timeval start, end; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
98 struct timespec delay; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
99 int usec_delay; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
100 unsigned last_samplecnt; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
101 unsigned increment; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
102 unsigned min_increment; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
103 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
104 len = 44100 * 4 / 4; // amount of data for 0.25sec of 44.1khz, stereo, 16bit |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
105 silence = calloc(1, len); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
106 if (silence == NULL) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
107 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
108 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
109 if ((fd = open(dev, O_WRONLY)) < 0) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
110 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
111 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
112 AUDIO_INITINFO(&info); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
113 info.play.sample_rate = 44100; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
114 info.play.channels = AUDIO_CHANNELS_STEREO; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
115 info.play.precision = AUDIO_PRECISION_16; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
116 info.play.encoding = AUDIO_ENCODING_LINEAR; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
117 info.play.samples = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
118 if (ioctl(fd, AUDIO_SETINFO, &info)) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
119 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
120 printf("rtsc: SETINFO failed\n"); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
121 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
122 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
123 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
124 if (write(fd, silence, len) != len) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
125 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
126 printf("rtsc: write failed"); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
127 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
128 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
129 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
130 if (ioctl(fd, AUDIO_GETINFO, &info)) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
131 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
132 perror("rtsc: GETINFO1"); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
133 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
134 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
135 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
136 last_samplecnt = info.play.samples; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
137 min_increment = ~0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
138 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
139 gettimeofday(&start, NULL); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
140 for (;;) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
141 delay.tv_sec = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
142 delay.tv_nsec = 10000000; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
143 nanosleep(&delay, NULL); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
144 gettimeofday(&end, NULL); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
145 usec_delay = (end.tv_sec - start.tv_sec) * 1000000 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
146 + end.tv_usec - start.tv_usec; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
147 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
148 // stop monitoring sample counter after 0.2 seconds |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
149 if (usec_delay > 200000) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
150 break; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
151 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
152 if (ioctl(fd, AUDIO_GETINFO, &info)) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
153 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
154 perror("rtsc: GETINFO2 failed"); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
155 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
156 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
157 if (info.play.samples < last_samplecnt) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
158 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
159 printf("rtsc: %d > %d?\n", last_samplecnt, info.play.samples); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
160 goto error; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
161 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
162 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
163 if ((increment = info.play.samples - last_samplecnt) > 0) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
164 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
165 printf("ao_sun: sample counter increment: %d\n", increment); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
166 if (increment < min_increment) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
167 min_increment = increment; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
168 if (min_increment < 2000) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
169 break; // looks good |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
170 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
171 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
172 last_samplecnt = info.play.samples; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
173 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
174 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
175 if (min_increment < 2000) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
176 rtsc_ok = RTSC_ENABLED; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
177 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
178 if (verbose) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
179 printf("ao_sun: minimum sample counter increment per 10msec interval: %d\n" |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
180 "\t%susing sample counter based timing code\n", |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
181 min_increment, rtsc_ok == RTSC_ENABLED ? "" : "not "); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
182 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
183 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
184 error: |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
185 if (silence != NULL) free(silence); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
186 if (fd >= 0) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
187 #ifdef __svr4__ |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
188 // remove the 0 bytes from the above measurement from the |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
189 // audio driver's STREAMS queue |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
190 ioctl(fd, I_FLUSH, FLUSHW); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
191 #endif |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
192 //ioctl(fd, AUDIO_DRAIN, 0); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
193 close(fd); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
194 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
195 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
196 return rtsc_ok; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
197 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
198 |
1041 | 199 // to set/get/query special features/parameters |
200 static int control(int cmd,int arg){ | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
201 switch(cmd){ |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
202 case AOCONTROL_SET_DEVICE: |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
203 audio_dev=(char*)arg; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
204 return CONTROL_OK; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
205 case AOCONTROL_QUERY_FORMAT: |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
206 return CONTROL_TRUE; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
207 } |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
208 return CONTROL_UNKNOWN; |
1041 | 209 } |
210 | |
211 // open & setup audio device | |
212 // return: 1=success 0=fail | |
213 static int init(int rate,int channels,int format,int flags){ | |
214 | |
215 audio_info_t info; | |
216 int byte_per_sec; | |
217 | |
1209 | 218 if (ao_subdevice) audio_dev = ao_subdevice; |
219 | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
220 if (enable_sample_timing == RTSC_UNKNOWN |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
221 && !getenv("AO_SUN_DISABLE_SAMPLE_TIMING")) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
222 enable_sample_timing = realtime_samplecounter_available(audio_dev); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
223 } |
1041 | 224 |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
225 printf("ao2: %d Hz %d chans %s [0x%X]\n", |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
226 rate,channels,audio_out_format_name(format),format); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
227 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
228 audio_fd=open(audio_dev, O_WRONLY); |
1041 | 229 if(audio_fd<0){ |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
230 printf("Can't open audio device %s, %s -> nosound\n", audio_dev, strerror(errno)); |
1041 | 231 return 0; |
232 } | |
233 | |
234 ioctl(audio_fd, AUDIO_DRAIN, 0); | |
235 | |
236 AUDIO_INITINFO(&info); | |
1058 | 237 info.play.encoding = oss2sunfmt(ao_format = format); |
238 info.play.precision = (format==AFMT_S16_LE? AUDIO_PRECISION_16:AUDIO_PRECISION_8); | |
1041 | 239 info.play.channels = ao_channels = channels; |
240 info.play.sample_rate = ao_samplerate = rate; | |
241 if(ioctl (audio_fd, AUDIO_SETINFO, &info)<0) | |
1058 | 242 printf("audio_setup: your card doesn't support %d channel, %s, %d Hz samplerate\n",channels,audio_out_format_name(format),rate); |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
243 bytes_per_sample = channels * info.play.precision / 8; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
244 byte_per_sec = bytes_per_sample * rate; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
245 ao_outburst = byte_per_sec > 100000 ? 16384 : 8192; |
1041 | 246 |
247 if(ao_buffersize==-1){ | |
248 // Measuring buffer size: | |
249 void* data; | |
250 ao_buffersize=0; | |
251 #ifdef HAVE_AUDIO_SELECT | |
252 data=malloc(ao_outburst); memset(data,0,ao_outburst); | |
253 while(ao_buffersize<0x40000){ | |
254 fd_set rfds; | |
255 struct timeval tv; | |
256 FD_ZERO(&rfds); FD_SET(audio_fd,&rfds); | |
257 tv.tv_sec=0; tv.tv_usec = 0; | |
258 if(!select(audio_fd+1, NULL, &rfds, NULL, &tv)) break; | |
259 write(audio_fd,data,ao_outburst); | |
260 ao_buffersize+=ao_outburst; | |
261 } | |
262 free(data); | |
263 if(ao_buffersize==0){ | |
264 printf("\n *** Your audio driver DOES NOT support select() ***\n"); | |
265 printf("Recompile mplayer with #undef HAVE_AUDIO_SELECT in config.h !\n\n"); | |
266 return 0; | |
267 } | |
268 #ifdef __svr4__ | |
1058 | 269 // remove the 0 bytes from the above ao_buffersize measurement from the |
270 // audio driver's STREAMS queue | |
1041 | 271 ioctl(audio_fd, I_FLUSH, FLUSHW); |
272 #endif | |
273 ioctl(audio_fd, AUDIO_DRAIN, 0); | |
274 #endif | |
275 } | |
276 | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
277 AUDIO_INITINFO(&info); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
278 info.play.samples = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
279 info.play.eof = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
280 info.play.error = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
281 ioctl (audio_fd, AUDIO_SETINFO, &info); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
282 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
283 queued_bursts = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
284 queued_samples = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
285 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
286 return 1; |
1041 | 287 } |
288 | |
289 // close audio device | |
290 static void uninit(){ | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
291 #ifdef __svr4__ |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
292 // throw away buffered data in the audio driver's STREAMS queue |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
293 ioctl(audio_fd, I_FLUSH, FLUSHW); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
294 #endif |
1041 | 295 close(audio_fd); |
296 } | |
297 | |
298 // stop playing and empty buffers (for seeking/pause) | |
299 static void reset(){ | |
300 audio_info_t info; | |
301 | |
302 uninit(); | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
303 audio_fd=open(audio_dev, O_WRONLY); |
1041 | 304 if(audio_fd<0){ |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
305 printf("\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE (%s) ***\n", strerror(errno)); |
1041 | 306 return; |
307 } | |
308 | |
309 ioctl(audio_fd, AUDIO_DRAIN, 0); | |
310 | |
311 AUDIO_INITINFO(&info); | |
1058 | 312 info.play.encoding = oss2sunfmt(ao_format); |
313 info.play.precision = (ao_format==AFMT_S16_LE? AUDIO_PRECISION_16:AUDIO_PRECISION_8); | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
314 info.play.channels = ao_channels; |
1041 | 315 info.play.sample_rate = ao_samplerate; |
316 info.play.samples = 0; | |
317 info.play.eof = 0; | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
318 info.play.error = 0; |
1041 | 319 ioctl (audio_fd, AUDIO_SETINFO, &info); |
320 queued_bursts = 0; | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
321 queued_samples = 0; |
1041 | 322 } |
323 | |
324 // stop playing, keep buffers (for pause) | |
325 static void audio_pause() | |
326 { | |
327 struct audio_info info; | |
328 AUDIO_INITINFO(&info); | |
329 info.play.pause = 1; | |
330 ioctl(audio_fd, AUDIO_SETINFO, &info); | |
331 } | |
332 | |
333 // resume playing, after audio_pause() | |
334 static void audio_resume() | |
335 { | |
336 struct audio_info info; | |
337 AUDIO_INITINFO(&info); | |
338 info.play.pause = 0; | |
339 ioctl(audio_fd, AUDIO_SETINFO, &info); | |
340 } | |
341 | |
342 | |
343 // return: how many bytes can be played without blocking | |
344 static int get_space(){ | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
345 int playsize = ao_outburst; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
346 audio_info_t info; |
1041 | 347 |
348 // check buffer | |
349 #ifdef HAVE_AUDIO_SELECT | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
350 { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
351 fd_set rfds; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
352 struct timeval tv; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
353 FD_ZERO(&rfds); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
354 FD_SET(audio_fd, &rfds); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
355 tv.tv_sec = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
356 tv.tv_usec = 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
357 if(!select(audio_fd+1, NULL, &rfds, NULL, &tv)) return 0; // not block! |
1041 | 358 } |
359 #endif | |
360 | |
361 ioctl(audio_fd, AUDIO_GETINFO, &info); | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
362 if (queued_bursts - info.play.eof > 2) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
363 return 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
364 |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
365 return ao_outburst; |
1041 | 366 } |
367 | |
368 // plays 'len' bytes of 'data' | |
369 // it should round it down to outburst*n | |
370 // return: number of bytes played | |
371 static int play(void* data,int len,int flags){ | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
372 if (len < ao_outburst) return 0; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
373 len /= ao_outburst; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
374 len = write(audio_fd, data, len*ao_outburst); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
375 if(len > 0) { |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
376 queued_samples += len / bytes_per_sample; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
377 if (write(audio_fd,data,0) < 0) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
378 perror("ao_sun: send EOF audio record"); |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
379 else |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
380 queued_bursts ++; |
1041 | 381 } |
382 return len; | |
383 } | |
384 | |
385 | |
386 // return: how many unplayed bytes are in the buffer | |
387 static int get_delay(){ | |
388 audio_info_t info; | |
389 ioctl(audio_fd, AUDIO_GETINFO, &info); | |
1196
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
390 if (info.play.samples && enable_sample_timing == RTSC_ENABLED) |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
391 return (queued_samples - info.play.samples) * bytes_per_sample; |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
392 else |
fc51929ec8ea
Applied patch by J¸«ärgen Keil (jk@tools.de), improves smoothness of video playback.
atmosfear
parents:
1058
diff
changeset
|
393 return (queued_bursts - info.play.eof) * ao_outburst; |
1041 | 394 } |
395 |