[MPlayer-dev-eng] libmpcodec / mpg123 decoder / decode_audio: what about stream errors?

Thomas Orgis thomas-forum at orgis.org
Sat Jul 3 00:04:33 CEST 2010


Hello,

I continued some testing of the mpg123 decoder in libmpcodec by watching
a football game over DVB-T ... at some point, the DVB-T receiver lost track
(while I was not paying attention) and the audio and video at some point
went frozen, but mplayer reacted to the 'q' key just fine.
I noticed a lot of messages from mpg123:

mpg123 decoding failed: No stream opened. (code 24)

That clearly correlates with the stream breaking down. The mpg123 decoder
sees more and more rubbish and, depending on configuration, gives up
after some time (number of rubbish bytes). The default is a finite number
of bytes, as that generally makes sense for an mp3 player that doesn't deal
with streams that are always at the danger of getting largely corrupted.
Now, one can configure mpg123 to try to resync forever on bad streams, and
that may indeed be the fix, but observing this output...

[mpeg2video @ 0xc912a0]slice mismatch
[mpeg2video @ 0xc912a0]00 motion_type at 0 30
[mpeg2video @ 0xc912a0]00 motion_type at 0 31
[mpeg2video @ 0xc912a0]ac-tex damaged at 0 32
[mpeg2video @ 0xc912a0]00 motion_type at 0 33
[mpeg2video @ 0xc912a0]00 motion_type at 7 34
[mpeg2video @ 0xc912a0]00 motion_type at 0 35
[mpeg2video @ 0xc912a0]concealing 1485 DC, 1485 AC, 1485 MV errors
[mpeg2video @ 0xc912a0]concealing 1485 DC, 1485 AC, 1485 MV errors1.0% 14 0 7% 
[mpeg2video @ 0xc912a0]ac-tex damaged at 30 11318/215318 12% 20%  1.0% 15 0 7% 
[mpeg2video @ 0xc912a0]invalid mb type in I Frame at 9 34
[mpeg2video @ 0xc912a0]invalid mb type in I Frame at 12 35
[mpeg2video @ 0xc912a0]concealing 315 DC, 315 AC, 315 MV errors
mpg123 decoding failed: Failed to find valid MPEG data within limit on resync. (code 28)
[mpeg2video @ 0xc912a0]ac-tex damaged at 20 1
[mpeg2video @ 0xc912a0]00 motion_type at 20 9
[mpeg2video @ 0xc912a0]concealing 450 DC, 450 AC, 450 MV errors
mpg123 decoding failed: No stream opened. (code 24)15320 12% 20%  1.0% 16 0 7% 
[mpeg2video @ 0xc912a0]concealing 450 DC, 450 AC, 450 MV errors
mpg123 decoding failed: No stream opened. (code 24)15321 12% 20%  1.0% 17 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15322 12% 20%  1.0% 17 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15323 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15324 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15325 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15326 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]concealing 245 DC, 245 AC, 245 MV errors
mpg123 decoding failed: No stream opened. (code 24)15327 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]00 motion_type at 9 0
[mpeg2video @ 0xc912a0]ac-tex damaged at 0 1
[mpeg2video @ 0xc912a0]concealing 105 DC, 105 AC, 105 MV errors
mpg123 decoding failed: No stream opened. (code 24)15328 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15329 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]mb incr damaged
[mpeg2video @ 0xc912a0]mb incr damaged
[mpeg2video @ 0xc912a0]concealing 461 DC, 461 AC, 461 MV errors
mpg123 decoding failed: No stream opened. (code 24)15330 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]skipped MB in I frame at 4 26
[mpeg2video @ 0xc912a0]skipped MB in I frame at 35 28
[mpeg2video @ 0xc912a0]ac-tex damaged at 38 30
[mpeg2video @ 0xc912a0]concealing 367 DC, 367 AC, 367 MV errors
mpg123 decoding failed: No stream opened. (code 24)15331 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15332 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15333 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15334 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15335 12% 20%  1.0% 18 0 7% 
mpg123 decoding failed: No stream opened. (code 24)15336 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]concealing 158 DC, 158 AC, 158 MV errors
mpg123 decoding failed: No stream opened. (code 24)15337 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]00 motion_type at 23 16
[mpeg2video @ 0xc912a0]00 motion_type at 16 25
[mpeg2video @ 0xc912a0]concealing 329 DC, 329 AC, 329 MV errors
mpg123 decoding failed: No stream opened. (code 24)15338 12% 20%  1.0% 18 0 7% 
[mpeg2video @ 0xc912a0]00 motion_type at 40 0
[mpeg2video @ 0xc912a0]invalid mb type in P Frame at 21 4
[mpeg2video @ 0xc912a0]00 motion_type at 23 13


... you see that the mpg123 decoder at one point gives up and closes the
handle, what triggers an error/EOF return code from decode_audio.
This seems to be pretty much ignored and mplayer continues to attempt
to decode more audio on the dead handle.

So, let's suppose we would not add the setting for mpg123 to try to find
valid audio data forever... is ad_mpg123 really supposed to do any stream
recovery itself? I thought when there is the notion of an error/EOF return
code of decode_audio, mplayer would at least try to reopen the stream
before decoding further.

In any case, a one-line patch to simply avoid this kind of predictable decoder
surrender (we're surrounded by broken streams, aren't we?;-) by configuring
mpg123 will be due, but I do wonder how one should deal with _real_
problems with the decoder ... or is anything in libmpcodec damned to succeed?


Alrighty then,

Thomas.

PS: The sound artifacts that I correlated with broken DVB-T and mp3lib are not
so clear to reproduce, sometimes I get a chirp on beginning of playback (after
filling buffer to 20%) ... this might happen on initial tuning / mplayer re-
tuning only. I tried to capture a stream via tzap and then
cat /dev/dvb/adapter0/dvr0 > file ... but was not able to reproduce conclusive
audio artifacts.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20100703/fae45070/attachment.pgp>


More information about the MPlayer-dev-eng mailing list