[MPlayer-users] Binary patch makes WMV2/WMA libs work on old processors :-) But QT ?

Eric Auer eric at CoLi.Uni-SB.DE
Mon May 27 02:55:02 CEST 2002


Hi,
I did the binary patch I was talking about, and it kind of worked.
The idea: remove all "rdtsc" (read time stamp counter, 0x0f 0x31)
opcodes from divxa32.acm and wmv8ds32.ax using xxd, a text editor
and then xxd -r (a normal hex editor would of course work as well).

So here is the diff for the hexdumps:

diff -Naur wmv8ds32.ax-old.xxd wmv8ds32.ax-new.xxd 
--- wmv8ds32.ax-old.xxd Mon May 27 02:31:16 2002
+++ wmv8ds32.ax-new.xxd Mon May 27 02:31:10 2002
@@ -11578,10 +11578,10 @@
 002d390: 421c 817d cc82 0100 0075 09c7 45fc 0a00  B..}.....u..E...
 002d3a0: 0000 eb71 817d cce6 0100 0075 0589 5dfc  ...q.}.....u..].
 002d3b0: eb63 5053 5152 9c58 8bc8 3500 0020 0050  .cPSQR.X..5.. .P
-002d3c0: 9d9c 5833 c174 0d8d bde0 ffff ff0f 3189  ..X3.t........1.
+002d3c0: 9d9c 5833 c174 0d8d bde0 ffff ff90 9089  ..X3.t..........
 002d3d0: 0789 5704 5a59 5b58 8b45 e00b 45e4 7435  ..W.ZY[X.E..E.t5
 002d3e0: 68f4 0100 00ff 1538 e042 1c8d bdd8 ffff  h......8.B......
-002d3f0: ff0f 3189 0789 5704 8b45 d88b 4ddc 2b45  ..1...W..E..M.+E
+002d3f0: ff90 9089 0789 5704 8b45 d88b 4ddc 2b45  ......W..E..M.+E
 002d400: e06a 0068 20a1 0700 1b4d e451 50e8 5ea7  .j.h ....M.QP.^.
 002d410: fdff 8945 fc8d 45fc 6a04 506a 046a 0056  ...E..E.j.Pj.j.V
 002d420: ff75 f8ff 1520 e042 1cff 75f8 8b35 00e0  .u... .B..u..5..

diff -Naur divxa32.acm-old.xxd divxa32.acm-new.xxd 
--- divxa32.acm-old.xxd Mon May 27 02:30:48 2002
+++ divxa32.acm-new.xxd Mon May 27 02:30:42 2002
@@ -4862,8 +4862,8 @@
 0012fd0: 0000 5064 8925 0000 0000 5151 83ec 1453  ..Pd.%....QQ...S
 0012fe0: 5657 8965 e8e8 0eff ffff 85c0 7442 a13c  VW.e........tB.<
 0012ff0: 3f22 1c83 f8ff 7f38 6a01 5883 65fc 008d  ?".....8j.X.e...
-0013000: bdd4 ffff ff0f 3189 0789 5704 0f28 c98d  ......1...W..(..
-0013010: bde0 ffff ff0f 3189 0789 5704 eb09 6a01  ......1...W...j.
+0013000: bdd4 ffff ff90 9089 0789 5704 0f28 c98d  ..........W..(..
+0013010: bde0 ffff ff90 9089 0789 5704 eb09 6a01  ..........W...j.
 0013020: 58c3 8b65 e833 c083 4dfc ffa3 3c3f 221c  X..e.3..M...<?".
 0013030: 8b4d f064 890d 0000 0000 5f5e 5bc9 c355  .M.d......_^[..U
 0013040: 8bec 51a1 343f 221c 83f8 ff75 3c83 65fc  ..Q.4?"....u<.e.
@@ -13730,7 +13730,7 @@
 0035a10: fb3d 81bd c8d9 dcbf 7507 b63d 55ef b9bf  .=......u..=U...
 0035a20: a4a3 6cbf 083d 9bbf 8293 d2be b64d dcbe  ..l..=.......M..
 0035a30: 106a 2abf 97a4 9c3f 0a1d f13b 1feb f73d  .j*....?...;...=
-0035a40: 9399 b3bf 0f31 e83f 9a1f 933f 1b47 5abf  .....1.?...?.GZ.
+0035a40: 9399 b3bf 9090 e83f 9a1f 933f 1b47 5abf  .......?...?.GZ.
 0035a50: 787f bf3e 0315 923f 36cc c23f 7951 c43e  x..>...?6..?yQ.>
 0035a60: 4205 18be 077e fcbd a556 b83e e566 863e  B....~...V.>.f.>
 0035a70: d274 b03f 5068 50bf 6afc 3c3f f161 d8bf  .t.?PhP.j.<?.a..

Please notice that I did not change ALL occurances of 0f 31, only
those which I believed that would be part of the code. And please
notice that binary patching is definitely the way to more unstable
software :-).

But in my case the success is as follows:

mplayer -framedrop mms://a789.v7014a.c7014.e.vm.akamaistream.net/7/789/7014/3cab13bb/estoniatv.download.akamai.com/7014/128k/23-Latvia.wmv

now gives me a "video" with a new picture only once every few seconds (no idea
if this is a bug caused by my patch or meant to be like this!) plus really
good sound quality.

So I guess the workaround (play WMV2/WMA streams with the Windows Media
Windows libraries even on a CPU -without- time stamp counter) has worked
good enough for me. A better workaround would be welcome, however!!

PS: I have a really crappy 133 MHz CPU, but still it seems to be fast
enough :-). And if I leave out the -framedrop option, I even get VIDEO
instead of a slideshow. Interesting compression artifacts with WMV2, by
the way, hehe. Well, but without -framedrop the video is almost one minute
longer playing than the sound! And this for a normal music clip. Strange
that framedrop reduced the frame rate that much!?

PPS: So to my friends with better processors: Yes, mplayer does play
Windows Media streams. I have hereby experienced it myself. But NO,
it doesn't play Sorenson encoded QuickTime :-(. Installing QuickTime
in Wine works, but the sound only works while (!) dragging the window,
and the things that you see are -very- bad, not even like a slide show.
This is about QuickTime 5 - QuickTime 2.1.2 works very smooth in Wine but
does not have the Sorenson codec. Yuck! Suggestions?

Greetings, Eric






More information about the MPlayer-users mailing list