avcodec_decode_audio4() resets the frame itself.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -272,8 +272,7 @@ static void audio_decode_example(const char *outfilename, const char *filename) · 271 unmodified lines | |||
| 272 | fprintf(stderr, "out of memory\n"); | 272 | fprintf(stderr, "out of memory\n"); |
| 273 | exit(1); | 273 | exit(1); |
| 274 | } | 274 | } |
| 275 | } else | 275 | } |
| 276 | avcodec_get_frame_defaults(decoded_frame); | ||
| 277 | 276 | ||
| 278 | len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt); | 277 | len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt); |
| 279 | if (len < 0) { | 278 | if (len < 0) { |