Line 0
Link Here
|
|
|
1 |
# Fix build with FFmpeg 3.x; obtained from https://git.reviewboard.kde.org/r/126682 |
2 |
# |
3 |
diff --git a/src/musicbrainz/MusicDNSAudioDecoder.cpp b/src/musicbrainz/MusicDNSAudioDecoder.cpp |
4 |
index 6216e5ce26cc3461b89aea560943ad7a79101af9..65a92fb43811d0cbdde5e2442880496b3417da68 100644 |
5 |
--- src/musicbrainz/MusicDNSAudioDecoder.cpp |
6 |
+++ src/musicbrainz/MusicDNSAudioDecoder.cpp |
7 |
@@ -243,7 +243,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
8 |
{ |
9 |
if( !decodedFrame ) |
10 |
{ |
11 |
- decodedFrame = avcodec_alloc_frame(); |
12 |
+ decodedFrame = av_frame_alloc(); |
13 |
if( !decodedFrame ) |
14 |
{ |
15 |
warning() << "Unable to allocate enough memory to decode file."; |
16 |
@@ -251,7 +251,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
17 |
break; |
18 |
} |
19 |
else |
20 |
- avcodec_get_frame_defaults( decodedFrame ); |
21 |
+ av_frame_unref( decodedFrame ); |
22 |
} |
23 |
|
24 |
decoderRet = avcodec_decode_audio4( pCodecCtx, decodedFrame, &gotFrame, &avpkt ); |
25 |
@@ -287,7 +287,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
26 |
|
27 |
avcodec_close( pCodecCtx ); |
28 |
avformat_close_input( &pFormatCtx ); |
29 |
- av_free( decodedFrame ); |
30 |
+ av_frame_free( &decodedFrame ); |
31 |
|
32 |
return data->duration(); |
33 |
} |
34 |
@@ -361,7 +361,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
35 |
{ |
36 |
if( !decodedFrame ) |
37 |
{ |
38 |
- decodedFrame = avcodec_alloc_frame(); |
39 |
+ decodedFrame = av_frame_alloc(); |
40 |
if( !decodedFrame ) |
41 |
{ |
42 |
warning() << "Unable to allocate enough memory to decode file."; |
43 |
@@ -369,7 +369,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
44 |
break; |
45 |
} |
46 |
else |
47 |
- avcodec_get_frame_defaults( decodedFrame ); |
48 |
+ av_frame_unref( decodedFrame ); |
49 |
} |
50 |
|
51 |
decoderRet = avcodec_decode_audio4( pCodecCtx, decodedFrame, &gotFrame, &avpkt ); |
52 |
@@ -405,7 +405,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
53 |
|
54 |
avcodec_close( pCodecCtx ); |
55 |
avformat_close_input( &pFormatCtx ); |
56 |
- av_free( decodedFrame ); |
57 |
+ av_frame_free( &decodedFrame ); |
58 |
|
59 |
return data->duration(); |
60 |
} |
61 |
@@ -479,7 +479,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
62 |
{ |
63 |
if( !decodedFrame ) |
64 |
{ |
65 |
- decodedFrame = avcodec_alloc_frame(); |
66 |
+ decodedFrame = av_frame_alloc(); |
67 |
if( !decodedFrame ) |
68 |
{ |
69 |
warning() << "Unable to allocate enough memory to decode file."; |
70 |
@@ -487,7 +487,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
71 |
break; |
72 |
} |
73 |
else |
74 |
- avcodec_get_frame_defaults( decodedFrame ); |
75 |
+ av_frame_unref( decodedFrame ); |
76 |
} |
77 |
|
78 |
decoderRet = avcodec_decode_audio4( pCodecCtx, decodedFrame, &gotFrame, &avpkt ); |
79 |
@@ -523,7 +523,7 @@ MusicDNSAudioDecoder::decode( const QString &fileName, DecodedAudioData *data, c |
80 |
|
81 |
avcodec_close( pCodecCtx ); |
82 |
av_close_input_file( pFormatCtx ); |
83 |
- av_free( decodedFrame ); |
84 |
+ av_frame_free( &decodedFrame ); |
85 |
|
86 |
return data->duration(); |
87 |
} |