[MPlayer-advusers] mplayer crash when geometry changes

David Hollister david.hollister at comcast.net
Sun Dec 4 00:51:06 CET 2011


On 12/ 3/11 04:15 PM, Reimar Döffinger wrote:
>>> You should be able to just cut out a few MB at the transition point with
>>> dd.
>>> I think there's even a command you could bind to a key top make MPlayer
>>> print the current file position in bytes.
>>> get_property stream_pos
>>> I think.

Yes, I had forgotten that MPEG-2 streams can be dissected like that.

I created a segment that's roughly 2MB in size.  You should be able grab 
it here:

http://wishingwell.homeip.net:8088/test.m2ts

I don't typically have this port open on my router, so please let me 
know when you've grabbed it so I can turn it back off.

>>> Would also appreciate if you could test my patch.
>>
>> I tried your patch, and it appears to work as expected.
>
> Good, I'll probably go ahead with that.

Great!  Glad I could help at least a little.

>>>> Index: libmpcodecs/dec_video.c
>>>> ===================================================================
>>>> --- libmpcodecs/dec_video.c	(revision 34378)
>>>> +++ libmpcodecs/dec_video.c	(working copy)
>>>> @@ -423,12 +423,16 @@
>>>>   #if HAVE_MMX
>>>>       // some codecs are broken, and doesn't restore MMX state :(
>>>>       // it happens usually with broken/damaged files.
>>>> +#if HAVE_AMD3DNOW
>>>>       if (gCpuCaps.has3DNow) {
>>>>           __asm__ volatile ("femms\n\t":::"memory");
>>>> -    } else if (gCpuCaps.hasMMX) {
>>>> +    } else
>>>> +#else
>>>> +    if (gCpuCaps.hasMMX) {
>>>>           __asm__ volatile ("emms\n\t":::"memory");
>>>>       }
>>>>   #endif
>>>> +#endif
>>>
>>> That will actually break --enable-runtime-cpudetection builds that
>>> are run on a CPU without 3DNow - neither emms nor femms will be
>>> executed in that case.
>>> Since 3DNow implies MMX the #if should just be split I think.
>>> Might get a bit ugly though.
>>
>> If you look closely at the patch, the #if HAVE_AMD3DNOW essentially
>> is breaking the if/else into just one "if" in the case where
>> HAVE_AMD3DNOW is 0.  I'm not arguing this is the best way to do
>> this, or is even correct.  Just wanted to ensure you didn't miss
>> that.
>
> The case to consider is
> HAVE_AMD3DNOW == 1
> gCpuCaps.has3DNow == 0
> gCpuCaps.hasMMX == 1
> old code executes EMMS, your patched code I just realized won't even
> compile if HAVE_AMD3DNOW is 1...

I tried it.  It appears to compile fine, but really it's neither here 
nor there at this point.  Although it seems to work fine in my 
particular case, I had no illusions that it was a realistic patch.  It 
was provided more just FYI.  I still plan to see what I can find out 
about the Solaris linker bailing when the AMD_3dnow HW capability is 
present.  If I find out anything of interest, I'll let you know.

David


More information about the MPlayer-advusers mailing list