Mercurial > mplayer.hg
annotate libmpcodecs/ad_mpg123.c @ 36425:e89214f37501
Remove unused definitions.
author | ib |
---|---|
date | Sun, 24 Nov 2013 00:44:44 +0000 |
parents | 3961f6dd9dff |
children |
rev | line source |
---|---|
31524 | 1 /* |
2 * MPEG 1.0/2.0/2.5 audio layer I, II, III decoding with libmpg123 | |
3 * | |
36365 | 4 * Copyright (C) 2010-2013 Thomas Orgis <thomas@orgis.org> |
31524 | 5 * |
6 * MPlayer is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * MPlayer is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License along | |
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 */ | |
20 | |
21 #include <stdio.h> | |
22 #include <stdlib.h> | |
23 #include <unistd.h> | |
24 | |
25 #include "config.h" | |
34174
a93891202051
Add missing mp_msg.h #includes, remove some unnecessary ones.
diego
parents:
31981
diff
changeset
|
26 #include "mp_msg.h" |
31524 | 27 #include "ad_internal.h" |
31981
ae5a36acc995
Add the proper include instead of declaring the fakemono variable extern.
diego
parents:
31666
diff
changeset
|
28 #include "dec_audio.h" |
31524 | 29 |
30 static const ad_info_t info = { | |
31 "MPEG 1.0/2.0/2.5 layers I, II, III", | |
32 "mpg123", | |
33 "Thomas Orgis", | |
34 "mpg123.org", | |
35 "High-performance decoder using libmpg123." | |
36 }; | |
37 | |
38 LIBAD_EXTERN(mpg123) | |
39 | |
40 #include "libvo/fastmemcpy.h" | |
41 | |
34722 | 42 /* Reducing the ifdeffery to two main variants: |
43 * 1. most compatible to any libmpg123 version | |
44 * 2. fastest variant with recent libmpg123 (>=1.14) | |
45 * Running variant 2 on older libmpg123 versions may work in | |
46 * principle, but is not supported. | |
47 * So, please leave the check for MPG123_API_VERSION there, m-kay? | |
48 */ | |
31524 | 49 #include <mpg123.h> |
50 | |
34722 | 51 /* Enable faster mode of operation with newer libmpg123, avoiding |
52 * unnecessary memcpy() calls. */ | |
53 #if (defined MPG123_API_VERSION) && (MPG123_API_VERSION >= 33) | |
54 #define AD_MPG123_FRAMEWISE | |
55 #endif | |
31524 | 56 |
57 /* Switch for updating bitrate info of VBR files. Not essential. */ | |
58 #define AD_MPG123_MEAN_BITRATE | |
59 | |
60 struct ad_mpg123_context { | |
61 mpg123_handle *handle; | |
36365 | 62 char new_format; |
31524 | 63 #ifdef AD_MPG123_MEAN_BITRATE |
64 /* Running mean for bit rate, stream length estimation. */ | |
65 float mean_rate; | |
66 unsigned int mean_count; | |
67 /* Time delay for updates. */ | |
68 short delay; | |
69 #endif | |
70 /* If the stream is actually VBR. */ | |
71 char vbr; | |
72 }; | |
73 | |
74 /* This initializes libmpg123 and prepares the handle, including funky | |
75 * parameters. */ | |
76 static int preinit(sh_audio_t *sh) | |
77 { | |
78 int err, flag; | |
79 struct ad_mpg123_context *con; | |
80 /* Assumption: You always call preinit + init + uninit, on every file. | |
81 * But you stop at preinit in case it fails. | |
82 * If that is not true, one must ensure not to call mpg123_init / exit | |
83 * twice in a row. */ | |
84 if (mpg123_init() != MPG123_OK) | |
85 return 0; | |
86 | |
36389
3961f6dd9dff
Use sizeof(*var) instead of sizeof(type), prefer calloc.
reimar
parents:
36388
diff
changeset
|
87 sh->context = con = calloc(sizeof(*con), 1); |
31524 | 88 /* Auto-choice of optimized decoder (first argument NULL). */ |
89 con->handle = mpg123_new(NULL, &err); | |
90 if (!con->handle) | |
91 goto bad_end; | |
92 | |
93 #ifdef CONFIG_FAKE_MONO | |
94 /* Guessing here: Default value triggers forced upmix of mono to stereo. */ | |
95 flag = fakemono == 0 ? MPG123_FORCE_STEREO : | |
96 fakemono == 1 ? MPG123_MONO_LEFT : | |
97 fakemono == 2 ? MPG123_MONO_RIGHT : 0; | |
98 if (mpg123_param(con->handle, MPG123_ADD_FLAGS, flag, 0.0) != MPG123_OK) | |
99 goto bad_end; | |
100 #endif | |
101 | |
102 /* Basic settings. | |
103 * Don't spill messages, enable better resync with non-seekable streams. | |
104 * Give both flags individually without error checking to keep going with | |
105 * old libmpg123. Generally, it is not fatal if the flags are not | |
106 * honored */ | |
107 mpg123_param(con->handle, MPG123_ADD_FLAGS, MPG123_QUIET, 0.0); | |
31666 | 108 /* Do not bail out on malformed streams at all. |
109 * MPlayer does not handle a decoder throwing the towel on crappy input. */ | |
110 mpg123_param(con->handle, MPG123_RESYNC_LIMIT, -1, 0.0); | |
31524 | 111 |
112 /* Open decisions: Configure libmpg123 to force encoding (or stay open about | |
113 * library builds that support only float or int32 output), (de)configure | |
114 * gapless decoding (won't work with seeking in MPlayer, though). | |
115 * Don't forget to eventually enable ReplayGain/RVA support, too. | |
116 * Let's try to run with the default for now. */ | |
117 | |
34722 | 118 /* That would produce floating point output. |
36365 | 119 * You can get 32 and 24 bit ints, even 8 bit via format matrix. |
120 * If wanting a specific encoding here, configure format matrix and | |
121 * make sure it is in set_format(). */ | |
34722 | 122 /* mpg123_param(con->handle, MPG123_ADD_FLAGS, MPG123_FORCE_FLOAT, 0.); */ |
123 | |
31524 | 124 /* Example for RVA choice (available since libmpg123 1.0.0): |
125 mpg123_param(con->handle, MPG123_RVA, MPG123_RVA_MIX, 0.0) */ | |
126 | |
34722 | 127 #ifdef AD_MPG123_FRAMEWISE |
128 /* Prevent funky automatic resampling. | |
129 * This way, we can be sure that one frame will never produce | |
130 * more than 1152 stereo samples. */ | |
131 mpg123_param(con->handle, MPG123_REMOVE_FLAGS, MPG123_AUTO_RESAMPLE, 0.); | |
132 #else | |
133 /* Older mpg123 is vulnerable to concatenated streams when gapless cutting | |
134 * is enabled (will only play the jingle of a badly constructed radio | |
135 * stream). The versions using framewise decoding are fine with that. */ | |
136 mpg123_param(con->handle, MPG123_REMOVE_FLAGS, MPG123_GAPLESS, 0.); | |
137 #endif | |
138 | |
31524 | 139 return 1; |
140 | |
141 bad_end: | |
142 if (!con->handle) | |
143 mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 preinit error: %s\n", | |
144 mpg123_plain_strerror(err)); | |
145 else | |
146 mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 preinit error: %s\n", | |
147 mpg123_strerror(con->handle)); | |
148 | |
149 if (con->handle) | |
150 mpg123_delete(con->handle); | |
151 mpg123_exit(); | |
152 free(sh->context); | |
153 sh->context = NULL; | |
154 return 0; | |
155 } | |
156 | |
157 /* Compute bitrate from frame size. */ | |
158 static int compute_bitrate(struct mpg123_frameinfo *i) | |
159 { | |
160 static const int samples_per_frame[4][4] = { | |
161 {-1, 384, 1152, 1152}, /* MPEG 1 */ | |
162 {-1, 384, 1152, 576}, /* MPEG 2 */ | |
163 {-1, 384, 1152, 576}, /* MPEG 2.5 */ | |
164 {-1, -1, -1, -1}, /* Unknown */ | |
165 }; | |
166 return (int) ((i->framesize + 4) * 8 * i->rate * 0.001 / | |
167 samples_per_frame[i->version][i->layer] + 0.5); | |
168 } | |
169 | |
170 /* Opted against the header printout from old mp3lib, too much | |
171 * irrelevant info. This is modelled after the mpg123 app's | |
172 * standard output line. | |
173 * If more verbosity is demanded, one can add more detail and | |
174 * also throw in ID3v2 info which libmpg123 collects anyway. */ | |
175 static void print_header_compact(struct mpg123_frameinfo *i) | |
176 { | |
36387 | 177 static const char * const smodes[5] = { |
31524 | 178 "stereo", "joint-stereo", "dual-channel", "mono", "invalid" |
179 }; | |
36387 | 180 static const char * const layers[4] = { |
31524 | 181 "Unknown", "I", "II", "III" |
182 }; | |
36387 | 183 static const char * const versions[4] = { |
31524 | 184 "1.0", "2.0", "2.5", "x.x" |
185 }; | |
186 | |
187 mp_msg(MSGT_DECAUDIO, MSGL_V, "MPEG %s layer %s, ", | |
188 versions[i->version], layers[i->layer]); | |
189 switch (i->vbr) { | |
190 case MPG123_CBR: | |
191 if (i->bitrate) | |
192 mp_msg(MSGT_DECAUDIO, MSGL_V, "%d kbit/s", i->bitrate); | |
193 else | |
194 mp_msg(MSGT_DECAUDIO, MSGL_V, "%d kbit/s (free format)", | |
195 compute_bitrate(i)); | |
196 break; | |
197 case MPG123_VBR: | |
198 mp_msg(MSGT_DECAUDIO, MSGL_V, "VBR"); | |
199 break; | |
200 case MPG123_ABR: | |
201 mp_msg(MSGT_DECAUDIO, MSGL_V, "%d kbit/s ABR", i->abr_rate); | |
202 break; | |
203 default: | |
204 mp_msg(MSGT_DECAUDIO, MSGL_V, "???"); | |
205 } | |
206 mp_msg(MSGT_DECAUDIO, MSGL_V, ", %ld Hz %s\n", i->rate, | |
207 smodes[i->mode]); | |
208 } | |
209 | |
36365 | 210 /* libmpg123 has a new format ready; query and store, return return value |
211 of mpg123_getformat() */ | |
212 static int set_format(sh_audio_t *sh, struct ad_mpg123_context *con) | |
213 { | |
214 int ret; | |
215 long rate; | |
216 int channels; | |
217 int encoding; | |
218 ret = mpg123_getformat(con->handle, &rate, &channels, &encoding); | |
219 if(ret == MPG123_OK) { | |
220 sh->channels = channels; | |
221 sh->samplerate = rate; | |
222 /* Without external force, mpg123 will always choose signed encoding, | |
223 * and non-16-bit only on builds that don't support it. | |
224 * Be reminded that it doesn't matter to the MPEG file what encoding | |
225 * is produced from it. */ | |
226 switch (encoding) { | |
227 case MPG123_ENC_SIGNED_8: | |
228 sh->sample_format = AF_FORMAT_S8; | |
229 sh->samplesize = 1; | |
230 break; | |
231 case MPG123_ENC_SIGNED_16: | |
232 sh->sample_format = AF_FORMAT_S16_NE; | |
233 sh->samplesize = 2; | |
234 break; | |
235 /* To stay compatible with the oldest libmpg123 headers, do not rely | |
236 * on float and 32 bit encoding symbols being defined. | |
237 * Those formats came later */ | |
238 case 0x1180: /* MPG123_ENC_SIGNED_32 */ | |
239 sh->sample_format = AF_FORMAT_S32_NE; | |
240 sh->samplesize = 4; | |
241 break; | |
242 case 0x200: /* MPG123_ENC_FLOAT_32 */ | |
243 sh->sample_format = AF_FORMAT_FLOAT_NE; | |
244 sh->samplesize = 4; | |
245 break; | |
246 default: | |
247 /* This means we got a funny custom build of libmpg123 that only supports an unknown format. */ | |
248 mp_msg(MSGT_DECAUDIO, MSGL_ERR, | |
249 "Bad encoding from mpg123: %i.\n", encoding); | |
250 return MPG123_ERR; | |
251 } | |
252 #ifdef AD_MPG123_FRAMEWISE | |
253 /* Going to decode directly to MPlayer's memory. It is important | |
254 * to have MPG123_AUTO_RESAMPLE disabled for the buffer size | |
255 * being an all-time limit. */ | |
256 sh->audio_out_minsize = 1152 * 2 * sh->samplesize; | |
257 #endif | |
258 con->new_format = 0; | |
259 } | |
260 return ret; | |
261 } | |
262 | |
31524 | 263 /* This tries to extract a requested amount of decoded data. |
264 * Even when you request 0 bytes, it will feed enough input so that | |
265 * the decoder _could_ have delivered something. | |
266 * Returns byte count >= 0, -1 on error. | |
267 * | |
268 * Thoughts on exact pts keeping: | |
269 * We have to assume that MPEG frames are cut in pieces by packet boundaries. | |
270 * Also, it might be possible that the first packet does not contain enough | |
271 * data to ensure initial stream sync... or re-sync on erroneous streams. | |
272 * So we need something robust to relate the decoded byte count to the correct | |
273 * time stamp. This is tricky, though. From the outside, you cannot tell if, | |
274 * after having fed two packets until the first output arrives, one should | |
275 * start counting from the first packet's pts or the second packet's. | |
276 * So, let's just count from the last fed package's pts. If the packets are | |
277 * exactly cut to MPEG frames, this will cause one frame mismatch in the | |
278 * beginning (when mpg123 peeks ahead for the following header), but will | |
279 * be corrected with the third frame already. One might add special code to | |
280 * not increment the base pts past the first packet's after a resync before | |
281 * the first decoded bytes arrived. */ | |
282 static int decode_a_bit(sh_audio_t *sh, unsigned char *buf, int count) | |
283 { | |
284 int ret = MPG123_OK; | |
285 int got = 0; | |
286 struct ad_mpg123_context *con = sh->context; | |
287 | |
288 /* There will be one MPG123_NEW_FORMAT message on first open. | |
34722 | 289 * This will be handled in init(). */ |
31524 | 290 do { |
291 size_t got_now = 0; | |
36365 | 292 /* Fetch new format now, after old data has been used. */ |
293 if(con->new_format) | |
294 ret = set_format(sh, con); | |
31524 | 295 |
34722 | 296 /* Feed the decoder. This will only fire from the second round on. */ |
31524 | 297 if (ret == MPG123_NEED_MORE) { |
298 int incount; | |
299 double pts; | |
300 unsigned char *inbuf; | |
301 /* Feed more input data. */ | |
302 incount = ds_get_packet_pts(sh->ds, &inbuf, &pts); | |
303 if (incount <= 0) | |
304 break; /* Apparently that's it. EOF. */ | |
305 | |
306 /* Next bytes from that presentation time. */ | |
307 if (pts != MP_NOPTS_VALUE) { | |
308 sh->pts = pts; | |
309 sh->pts_bytes = 0; | |
310 } | |
34722 | 311 |
312 #ifdef AD_MPG123_FRAMEWISE | |
313 /* Have to use mpg123_feed() to avoid decoding here. */ | |
314 ret = mpg123_feed(con->handle, inbuf, incount); | |
31524 | 315 #else |
316 /* Do not use mpg123_feed(), added in later libmpg123 versions. */ | |
317 ret = mpg123_decode(con->handle, inbuf, incount, NULL, 0, NULL); | |
34722 | 318 #endif |
319 if (ret == MPG123_ERR) | |
320 break; | |
36365 | 321 |
322 /* Indication of format change is possible here (from mpg123_decode()). */ | |
323 if(ret == MPG123_NEW_FORMAT) { | |
324 con->new_format = 1; | |
325 if(got) | |
326 break; /* Do not switch format during a chunk. */ | |
327 | |
328 ret = set_format(sh, con); | |
329 } | |
31524 | 330 } |
34722 | 331 /* Theoretically, mpg123 could return MPG123_DONE, so be prepared. |
332 * Should not happen in our usage, but it is a valid return code. */ | |
31524 | 333 else if (ret == MPG123_ERR || ret == MPG123_DONE) |
334 break; | |
335 | |
34722 | 336 /* Try to decode a bit. This is the return value that counts |
337 * for the loop condition. */ | |
338 #ifdef AD_MPG123_FRAMEWISE | |
339 if (!buf) { /* fake call just for feeding to get format */ | |
36365 | 340 ret = set_format(sh, con); |
34722 | 341 } else { /* This is the decoding. One frame at a time. */ |
342 ret = mpg123_replace_buffer(con->handle, buf, count); | |
343 if (ret == MPG123_OK) | |
344 ret = mpg123_decode_frame(con->handle, NULL, NULL, &got_now); | |
345 } | |
346 #else | |
347 ret = mpg123_decode(con->handle, NULL, 0, buf + got, count - got, | |
348 &got_now); | |
349 #endif | |
350 | |
351 got += got_now; | |
352 sh->pts_bytes += got_now; | |
353 | |
36365 | 354 /* Indication of format change should happen here. */ |
355 if(ret == MPG123_NEW_FORMAT) { | |
356 con->new_format = 1; | |
357 if(got) | |
358 break; /* Do not switch format during a chunk. */ | |
359 | |
360 ret = set_format(sh, con); | |
361 } | |
362 | |
34722 | 363 #ifdef AD_MPG123_FRAMEWISE |
364 } while (ret == MPG123_NEED_MORE || (got == 0 && count != 0)); | |
365 #else | |
31524 | 366 } while (ret == MPG123_NEED_MORE || got < count); |
34722 | 367 #endif |
31524 | 368 |
369 if (ret == MPG123_ERR) { | |
370 mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 decoding failed: %s\n", | |
371 mpg123_strerror(con->handle)); | |
372 } | |
373 | |
374 return got; | |
375 } | |
376 | |
377 /* Close, reopen stream. Feed data until we know the format of the stream. | |
378 * 1 on success, 0 on error */ | |
379 static int reopen_stream(sh_audio_t *sh) | |
380 { | |
36388 | 381 struct ad_mpg123_context *con = sh->context; |
31524 | 382 |
383 mpg123_close(con->handle); | |
34722 | 384 /* No resetting of the context: |
385 * We do not want to loose the mean bitrate data. */ | |
31524 | 386 |
34722 | 387 /* Open and make sure we have fed enough data to get stream properties. */ |
388 if (MPG123_OK == mpg123_open_feed(con->handle) && | |
31524 | 389 /* Feed data until mpg123 is ready (has found stream beginning). */ |
36365 | 390 !decode_a_bit(sh, NULL, 0) && |
391 set_format(sh, con) == MPG123_OK) { /* format setting again just for return value */ | |
31524 | 392 return 1; |
393 } else { | |
394 mp_msg(MSGT_DECAUDIO, MSGL_ERR, | |
395 "mpg123 failed to reopen stream: %s\n", | |
396 mpg123_strerror(con->handle)); | |
397 return 0; | |
398 } | |
399 } | |
400 | |
401 /* Now we really start accessing some data and determining file format. | |
36365 | 402 * Format now is allowed to change on-the-fly. Here is the only point |
403 * that has MPlayer react to errors. We have to pray that exceptional | |
404 * erros in other places simply cannot occur. */ | |
31524 | 405 static int init(sh_audio_t *sh) |
406 { | |
407 mpg123_id3v2 *v2; | |
408 struct mpg123_frameinfo finfo; | |
409 struct ad_mpg123_context *con = sh->context; | |
410 | |
36365 | 411 con->new_format = 0; |
412 if (reopen_stream(sh) && | |
31524 | 413 /* Get MPEG header info. */ |
414 MPG123_OK == mpg123_info(con->handle, &finfo) && | |
415 /* Since we queried format, mpg123 should have read past ID3v2 tags. | |
416 * We need to decide if printing of UTF-8 encoded text info is wanted. */ | |
417 MPG123_OK == mpg123_id3(con->handle, NULL, &v2)) { | |
418 /* If we are here, we passed all hurdles. Yay! Extract the info. */ | |
419 print_header_compact(&finfo); | |
420 /* Do we want to print out the UTF-8 Id3v2 info? | |
421 if (v2) | |
422 print_id3v2(v2); */ | |
423 | |
424 /* Have kb/s, want B/s | |
425 * For VBR, the first frame will be a bad estimate. */ | |
426 sh->i_bps = (finfo.bitrate ? finfo.bitrate : compute_bitrate(&finfo)) | |
427 * 1000 / 8; | |
34722 | 428 #ifdef AD_MPG123_MEAN_BITRATE |
429 con->delay = 1; | |
430 con->mean_rate = 0.; | |
431 con->mean_count = 0; | |
432 #endif | |
31524 | 433 con->vbr = (finfo.vbr != MPG123_CBR); |
434 | |
435 return 1; | |
436 } else { | |
437 mp_msg(MSGT_DECAUDIO, MSGL_ERR, "mpg123 init error: %s\n", | |
438 mpg123_strerror(con->handle)); | |
439 return 0; | |
440 } | |
441 } | |
442 | |
443 static void uninit(sh_audio_t *sh) | |
444 { | |
36388 | 445 struct ad_mpg123_context *con = sh->context; |
31524 | 446 |
447 mpg123_close(con->handle); | |
448 mpg123_delete(con->handle); | |
449 free(sh->context); | |
450 sh->context = NULL; | |
451 mpg123_exit(); | |
452 } | |
453 | |
454 #ifdef AD_MPG123_MEAN_BITRATE | |
455 /* Update mean bitrate. This could be dropped if accurate time display | |
456 * on audio file playback is not desired. */ | |
457 static void update_info(sh_audio_t *sh) | |
458 { | |
459 struct ad_mpg123_context *con = sh->context; | |
460 if (con->vbr && --con->delay < 1) { | |
461 struct mpg123_frameinfo finfo; | |
462 if (MPG123_OK == mpg123_info(con->handle, &finfo)) { | |
463 if (++con->mean_count > ((unsigned int) -1) / 2) | |
464 con->mean_count = ((unsigned int) -1) / 4; | |
465 | |
466 /* Might not be numerically optimal, but works fine enough. */ | |
467 con->mean_rate = ((con->mean_count - 1) * con->mean_rate + | |
468 finfo.bitrate) / con->mean_count; | |
469 sh->i_bps = (int) (con->mean_rate * 1000 / 8); | |
470 | |
471 con->delay = 10; | |
472 } | |
473 } | |
474 } | |
475 #endif | |
476 | |
477 static int decode_audio(sh_audio_t *sh, unsigned char *buf, int minlen, | |
478 int maxlen) | |
479 { | |
480 int bytes; | |
481 | |
34722 | 482 bytes = decode_a_bit(sh, buf, maxlen); |
36365 | 483 /* This EOF is ignored, apparently, until input data is exhausted. */ |
31524 | 484 if (bytes == 0) |
485 return -1; /* EOF */ | |
486 | |
487 #ifdef AD_MPG123_MEAN_BITRATE | |
488 update_info(sh); | |
489 #endif | |
490 return bytes; | |
491 } | |
492 | |
493 static int control(sh_audio_t *sh, int cmd, void *arg, ...) | |
494 { | |
495 switch (cmd) { | |
496 case ADCTRL_RESYNC_STREAM: | |
497 /* Close/reopen the stream for mpg123 to make sure it doesn't | |
498 * think that it still knows the exact stream position. | |
499 * Otherwise, we would have funny effects from the gapless code. | |
500 * Oh, and it helps to minimize artifacts from jumping in the stream. */ | |
501 if (reopen_stream(sh)) { | |
502 #ifdef AD_MPG123_MEAN_BITRATE | |
503 update_info(sh); | |
504 #endif | |
505 return CONTROL_TRUE; | |
506 } else { | |
34797
079b53acda6d
Workaround bug in mpg123. In rare cases, after seeking mplayer stops audio playback and would repeat "No stream opened. (code 24)" until next seek.
iive
parents:
34722
diff
changeset
|
507 /* MPlayer ignores this case! It just keeps on decoding. |
079b53acda6d
Workaround bug in mpg123. In rare cases, after seeking mplayer stops audio playback and would repeat "No stream opened. (code 24)" until next seek.
iive
parents:
34722
diff
changeset
|
508 * So we have to make sure resync never fails ... */ |
31524 | 509 mp_msg(MSGT_DECAUDIO, MSGL_ERR, |
510 "mpg123 cannot reopen stream for resync.\n"); | |
511 return CONTROL_FALSE; | |
512 } | |
513 break; | |
514 } | |
515 return CONTROL_UNKNOWN; | |
516 } |