@@ -2332,15 +2332,11 @@ static int send_frame_to_filters(InputStream *ist, AVFrame *decoded_frame)
2332
2332
static int decode_audio (InputStream * ist , AVPacket * pkt , int * got_output ,
2333
2333
int * decode_failed )
2334
2334
{
2335
- AVFrame * decoded_frame ;
2335
+ AVFrame * decoded_frame = ist -> decoded_frame ;
2336
2336
AVCodecContext * avctx = ist -> dec_ctx ;
2337
2337
int ret , err = 0 ;
2338
2338
AVRational decoded_frame_tb ;
2339
2339
2340
- if (!ist -> decoded_frame && !(ist -> decoded_frame = av_frame_alloc ()))
2341
- return AVERROR (ENOMEM );
2342
- decoded_frame = ist -> decoded_frame ;
2343
-
2344
2340
update_benchmark (NULL );
2345
2341
ret = decode (avctx , decoded_frame , got_output , pkt );
2346
2342
update_benchmark ("decode_audio %d.%d" , ist -> file_index , ist -> st -> index );
@@ -2397,7 +2393,7 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
2397
2393
static int decode_video (InputStream * ist , AVPacket * pkt , int * got_output , int64_t * duration_pts , int eof ,
2398
2394
int * decode_failed )
2399
2395
{
2400
- AVFrame * decoded_frame ;
2396
+ AVFrame * decoded_frame = ist -> decoded_frame ;
2401
2397
int i , ret = 0 , err = 0 ;
2402
2398
int64_t best_effort_timestamp ;
2403
2399
int64_t dts = AV_NOPTS_VALUE ;
@@ -2408,9 +2404,6 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
2408
2404
if (!eof && pkt && pkt -> size == 0 )
2409
2405
return 0 ;
2410
2406
2411
- if (!ist -> decoded_frame && !(ist -> decoded_frame = av_frame_alloc ()))
2412
- return AVERROR (ENOMEM );
2413
- decoded_frame = ist -> decoded_frame ;
2414
2407
if (ist -> dts != AV_NOPTS_VALUE )
2415
2408
dts = av_rescale_q (ist -> dts , AV_TIME_BASE_Q , ist -> st -> time_base );
2416
2409
if (pkt ) {
0 commit comments