Bug 325486 - k3b not compatible with ffmpeg 2.0.1
Summary: k3b not compatible with ffmpeg 2.0.1
Status: RESOLVED FIXED
Alias: None
Product: k3b
Classification: Applications
Component: Plugins (show other bugs)
Version: 2.0.80
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Michał Małek
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2013-10-01 08:07 UTC by MaxiPunkt
Modified: 2013-11-19 18:13 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch that should fix the issue (573 bytes, patch)
2013-10-01 11:53 UTC, Christoph Feck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MaxiPunkt 2013-10-01 08:07:12 UTC
I wanted to give k3b in latest git-version (hash: bdba0f56) a try on my system (Fedora FC18, 64bit).

With ffmpeg-2.0.1 it actually fails to compile.
If I switch back again to old ffmpeg-1.2, everything is fine.

Reproducible: Always
Comment 1 Christoph Feck 2013-10-01 11:53:33 UTC
Created attachment 82585 [details]
Patch that should fix the issue
Comment 2 Christoph Feck 2013-10-01 11:54:50 UTC
Above is the local patch that I currently have to make it build. I do not like it but I had no time yet to see what the correct porting solution is.
Comment 3 MaxiPunkt 2013-10-03 09:30:50 UTC
Thanks, your patch does work for me, too!   :o)

Don't know what "AVCODEC_MAX_AUDIO_FRAME_SIZE" is for, and why it should be a value of "192.000", but there are quite similar patches around from Gentoo & Arch-Linux.

Tried those patches before filling this bug-report, but Gentoo- & Arch-Linux patches didn't work for me...
Comment 4 MaxiPunkt 2013-10-03 10:00:55 UTC
Ha, I've looked at ffmpeg-code: 

in "libavformat/dvenc.c" is defined:
#define MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio

In old ffmpeg-versions, there is additionally defined in "libavcodec/avcodec.h":
#if FF_API_OLD_DECODE_AUDIO
/* in bytes */
#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
#endif

This additional define has gone in ffmpeg-2.0.1

So seems that "AVCODEC_MAX_AUDIO_FRAME_SIZE" is deprecated by replacing it with "MAX_AUDIO_FRAME_SIZE" - right???
Comment 5 MaxiPunkt 2013-10-05 10:23:11 UTC
I now read through ffmpeg's "APIchanges" about deprecated functions.
Then I searched those deprecated routines in k3b-code and could spot some:
* avcodec_decode_audio()
* avcodec_decode_audio2()
* avcodec_decode_audio3()
* av_close_input_file()

All these routines are marked as being deprecated by upstream, but k3b tries to use them.
Only some of them are still in ffmpeg-code for compatiblity-reasons, but will be wiped in the near future.

As I understood ffmpeg's docs, the functions mentioned above should be replaced by:
* avcodec_decode_audio4()
* avformat_close_input()

So it seems there is a lot more work to do on k3b-code beside this "AVCODEC_MAX_AUDIO_FRAME_SIZE"-thing, to keep it up-to-date with current ffmpeg.

Sadly I'm only able to compile from source, but I do not have coding-skills at all. Who is willing to dig into this?
Comment 6 Christoph Feck 2013-10-12 20:22:36 UTC
Thanks for your analysis, Max.

Porting k3b to non-deprecated FFMPEG functions could be an interesting (junior-)job for KDE multimedia developers.
Comment 7 Rex Dieter 2013-11-01 13:25:51 UTC
See https://git.reviewboard.kde.org/r/113295/
Comment 9 MaxiPunkt 2013-11-19 18:13:44 UTC
Hi there,

tried to compile git-hash: b0e04c0f on my system - and it does work for me.

Thank you for fixing this.