Bug 362409

Summary: Git master 2016-04-28: Fails to compile against ffmpeg version 3.0.1
Product: [Applications] amarok Reporter: Evert Vorster <evorster>
Component: generalAssignee: Amarok Bugs <amarok-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 2.8-git   
Target Milestone: 2.9   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 2.9
Sentry Crash Report:

Description Evert Vorster 2016-04-28 12:14:31 UTC
Hi there. 

I am trying to compile amarok from the latest git, and it fails. 
I am not going to post the entire compile log, just the error part.
I did a quick google search, and found a similar build error. It appears that some libav headers were moved:

http://ffmpeg.org/pipermail/libav-user/2016-February/008840.html

It should be an easy, straightforward fix. 

Here is the bit of the log with the failure:
--------------------------------------------------------------------------------------------
[ 58%] Building CXX object src/CMakeFiles/amaroklib.dir/LastfmReadLabelCapability.cpp.o                                                                                     
[ 58%] Building CXX object src/CMakeFiles/amaroklib.dir/musicbrainz/MusicDNSAudioDecoder.cpp.o                                                                              
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp: In member function ‘int MusicDNSAudioDecoder::decode(const QString&, DecodedAudioData*, int)’:
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:226:56: error: ‘avcodec_alloc_frame’ was not declared in this scope
                     decodedFrame = avcodec_alloc_frame();
                                                        ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:234:66: error: ‘avcodec_get_frame_defaults’ was not declared in this scope
                         avcodec_get_frame_defaults( decodedFrame );
                                                                  ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:260:9: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
         av_free_packet( &packet );
         ^
In file included from /tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:27:0:
/usr/include/libavcodec/avcodec.h:4040:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:260:9: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
         av_free_packet( &packet );
         ^
In file included from /tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:27:0:
/usr/include/libavcodec/avcodec.h:4040:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:260:33: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
         av_free_packet( &packet );
                                 ^
In file included from /tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:27:0:
/usr/include/libavcodec/avcodec.h:4040:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:266:5: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     av_free_packet( &avpkt );
     ^
In file included from /tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:27:0:
/usr/include/libavcodec/avcodec.h:4040:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:266:5: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     av_free_packet( &avpkt );
     ^
In file included from /tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:27:0:
/usr/include/libavcodec/avcodec.h:4040:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
/tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:266:28: warning: ‘void av_free_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
     av_free_packet( &avpkt );
                            ^
In file included from /tmp/yaourt-tmp-evert/aur-amarok-git/src/amarok-git/src/musicbrainz/MusicDNSAudioDecoder.cpp:27:0:
/usr/include/libavcodec/avcodec.h:4040:6: note: declared here
 void av_free_packet(AVPacket *pkt);
      ^
src/CMakeFiles/amaroklib.dir/build.make:11328: recipe for target 'src/CMakeFiles/amaroklib.dir/musicbrainz/MusicDNSAudioDecoder.cpp.o' failed
make[2]: *** [src/CMakeFiles/amaroklib.dir/musicbrainz/MusicDNSAudioDecoder.cpp.o] Error 1
CMakeFiles/Makefile2:1265: recipe for target 'src/CMakeFiles/amaroklib.dir/all' failed
make[1]: *** [src/CMakeFiles/amaroklib.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build amarok-git.
==> Restart building amarok-git ? [y/N]
==> -----------------------------------


Reproducible: Always
Comment 1 Myriam Schweingruber 2017-02-13 18:32:18 UTC
This should be fixed now:

Git commit 5535be8635d3f74ccc774ee28e0804d7aaeeec41 by Andreas Sturmlechner, on behalf of Alexis BALLIER.
Committed on 12/02/2017 at 17:06.
Pushed by asturmlechner into branch 'master'.

Fix amarok build with LibOFA using ffmpeg 3+

Testing Done:
https://bugs.gentoo.org/show_bug.cgi?id=601800

REVIEW: 129626

M  +6    -6    src/musicbrainz/MusicDNSAudioDecoder.cpp

https://commits.kde.org/amarok/5535be8635d3f74ccc774ee28e0804d7aaeeec41