albertz / music-player-core

Music player core Python module
BSD 2-Clause "Simplified" License
76 stars 22 forks source link

improved audio_decode_frame method #12

Closed roosnic1 closed 6 years ago

roosnic1 commented 7 years ago

I couldn't install music-player-core with pip on python 2.7.10 and when i tried to compile the package i got the following errors.

musicplayer_player_decoding.cpp:807:23: error: use of undeclared identifier 'avcodec_alloc_frame' musicplayer_player_decoding.cpp:810:5: error: use of undeclared identifier 'avcodec_get_frame_defaults'

I then replaced avcodec_alloc_frame() with av_frame_alloc() and removed avcodec_get_frame_defaults(is->frame) because avcodec_decode_audio4() apparently will reset the frame itself. After that i could compile the project and also install it with pip. I tested the musicplayer with the example code and it worked.

I'm not at all confident with c++ and therefor not sure if my fix breaks more than it will fix.

I work on a Mac 10.11.6 with Apple LLVM version 8.0.0.

ghost commented 6 years ago

@albertz @bryanjos @fredericgermain @christophmluscher could one of you merge this? I can confirm that it fixes the installation error on Ubuntu 18.04 LTS.

albertz commented 6 years ago

This should be fixed now.