Opened 9 years ago

Closed 9 years ago

#6802 closed bug (fixed)

MediaPlayer crashes in ffmpeg plugin

Reported by: korli Owned by: nobody
Priority: normal Milestone: R1
Component: Audio & Video/Codecs Version: R1/alpha2
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Thread 17457 caused an exception: Segment violation
[Switching to team /boot/system/apps/MediaPlayer (17432) thread MediaPlayer audio ou control (17457)]
0x01fdbd87 in sbr_make_f_master ()
   from /boot/system/add-ons/media/plugins/ffmpeg
(gdb) bt 
#0  0x01fdbd87 in sbr_make_f_master ()
   from /boot/system/add-ons/media/plugins/ffmpeg
#1  0x00000000 in ?? ()
(gdb) 

ArteTV .ts Mediaplayer hrev39344 works with vlc 0.8.6d

Change History (8)

comment:2 by korli, 9 years ago

Tried the same video clip with ffplay 0.6 on Linux and it segfaults too. Tried with 0.6.1 and it plays OK.

It seems a ffmpeg update is required.

comment:3 by stippi, 9 years ago

Thanks for the investigation! If you feel like upgrading (and perhaps you are a good candidate considering all your experience with vendor branches), I am more than willing to help you sort out the required patches. Almost all should be visible in the follow up changesets, there is only one modification with regards to including an "internal.h" header to prevent including the wrong one (there are multiple headers of this name across libavutil and libavcodec and perhaps also libavformat). Alternatively, you could replace the FFmpeg files with verbatim copies from 0.6 and extract a proper diff that way.

comment:4 by korli, 9 years ago

I updated ffmpeg to 0.6.1 in hrev39560, but it doesn't seem to fix this problem in Haiku.

comment:5 by korli, 9 years ago

Having looked deeper, it seems the crash happens in sbr_make_f_master() for some unknown reason. For instance, the value of the sbr pointer parameter changed to null (nothing in the code indicates such a change). This is as if the stack was being corrupted after the line

num_bands_0 = lrintf(half_bands * log2f(sbr->k[1] / (float)sbr->k[0])) * 2;

It looks like calls to libroot functions. Maybe these don't behave correctly because of current ffmpeg build options on GCC2 (-fomit-frame-pointer -fPIC).

It would be interesting to check the behavior on GCC4.

comment:6 by diver, 9 years ago

FWIW, in hrev39566 gcc4hybrid MediaPlayer doesn't crash with this file, but have some problems with duration and it seems to repeat first several frames forewer.

comment:7 by korli, 9 years ago

Fixed in hrev39620. It seems ffmpeg was using the default prototype for log2f, int log2f().

comment:8 by stippi, 9 years ago

Resolution: fixed
Status: newclosed

Wow, thanks for tracking this down, korli!

Note: See TracTickets for help on using tickets.