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