Skip to content
Snippets Groups Projects
Commit 4752e41f authored by Sam Lade's avatar Sam Lade
Browse files

MusicBrainz: Deal with functions removed from ffmpeg

ffmpeg 0.11 removed av_open_input_file, and current git libav removed
av_find_stream_info and avcodec_open. #if uses of these functions to
build on new ffmpeg/libav without removing ffmpeg 0.6 compatibility.
There's still lots of deprecation warnings, but it builds.

Thanks to Christoph Feck for pointing out the release of ffmpeg 0.11 broke
av_open_input_file and the toAscii() -> toLocal8Bit() fix.

REVIEW:105073
parent e9e37f30
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,7 @@ VERSION 2.6-Beta 1
vice versa. (BR 142579)
CHANGES:
* Builds with ffmpeg 0.11.
* Database structure (lyrics table) was updated. Starting Amarok for the first
time after the upgrade may take up to one minute as the data is migrated.
* Amazon store: try to show a sensible default in the country selection.
......
......@@ -135,14 +135,21 @@ MusicDNSAudioDecoder::run()
foreach( Meta::TrackPtr track, m_tracks )
{
//TODO replace with "avformat_open_input" since av_open_input_file is deprecated
if( av_open_input_file( &pFormatCtx, ( const char * )track->playableUrl().toLocalFile().toAscii(), NULL, 0, NULL ) )
#if LIBAVFORMAT_VERSION_MAJOR >= 53
if( avformat_open_input( &pFormatCtx, ( const char * )track->playableUrl().toLocalFile().toLocal8Bit(), NULL, NULL ) )
#else
if( av_open_input_file( &pFormatCtx, ( const char * )track->playableUrl().toLocalFile().toLocal8Bit(), NULL, 0, NULL ) )
#endif
{
warning() << QLatin1String( "Unable to open input file: " ) + track->playableUrl().toLocalFile();
continue;
}
#if LIBAVFORMAT_VERSION_MAJOR >= 54
if( avformat_find_stream_info( pFormatCtx, NULL ) < 0 )
#else
if( av_find_stream_info( pFormatCtx ) < 0 )
#endif
{
warning() << QLatin1String( "Unable to find stream info: " ) + track->playableUrl().toLocalFile();
av_close_input_file( pFormatCtx );
......@@ -173,7 +180,11 @@ MusicDNSAudioDecoder::run()
continue;
}
#if LIBAVCODEC_VERSION_MAJOR >= 54
if( avcodec_open2( pCodecCtx, pCodec, NULL ) < 0 )
#else
if( avcodec_open( pCodecCtx, pCodec ) < 0 )
#endif
{
warning() << QLatin1String( "Unable to open codec " ) + track->playableUrl().toLocalFile();
av_close_input_file( pFormatCtx );
......@@ -259,4 +270,4 @@ MusicDNSAudioDecoder::run()
}
#include "MusicDNSAudioDecoder.moc"
\ No newline at end of file
#include "MusicDNSAudioDecoder.moc"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment