Implement ffmpeg 5.0 support #9
Merged
SlavekB
merged 1 commits from ffmpeg5-support
into master
2 years ago
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'ffmpeg5-support'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Version 5.0 of ffmpeg removed a lot of deprecated API which causes akode to fail to build against it. The ffmpeg plugin has been amended to allow akode to build against the new version as well as older versions, plus a call to "av_register_all" has been re-instated for earlier versions to ensure the player functions correctly.
Signed-off-by: aneejit1 aneejit1@gmail.com
As far as I can tell, the removed call to "av_register_all" has caused the ffmpeg plugin to be unusable to the extent that it refused to open the input file and then segfaults. This is the situation when akode is built for Debian 9.
Restoring this call has enabled the player to get past these errors.
However, my Debian 9 system is in a virtual machine and appears to be having issues with playback that I suspect may be due to the limited CPU resources it has (I'm getting heavy distortion). A little additional testing on an older system would be helpful before merging this one. The plugin can be invoked when ".wma" or ".m4a" format files are used.I've got playback for ffmpeg 5 working fine.
EDIT
I found the problem with my Debian 9 playback and that's working fine now too, so this one's good to go.
I did a test on the old system and got FTBFS – see comments below.
// allocate a codec context
d->audioStream_ctx = avcodec_alloc_context3(d->codec);
if (d->audioStream_ctx) {
avcodec_parameters_to_context(d->audioStream_ctx, d->ic->streams[d->audioStream]->codecpar);
I'd got the wrong version check in. This and the missing ampersand have been corrected, so give it another go.
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 12, 100)
d->packet = av_packet_alloc();
#else
av_init_packet(d->_packet);
Oops! Missing an ampersand!
40b64f4b1c
toc057782b44
2 years agoc057782b44
to9e2710c9d8
2 years agoTested on a very old distribution and also on unstable – both without any problems.
9e2710c9d8
into master 2 years agoReviewers
9e2710c9d8
.