comparison utils.c @ 2453:f67b63ed036d libavcodec

avoid buf_size == 0 checks in every decoder
author michael
date Sun, 23 Jan 2005 18:09:06 +0000
parents 1ee03f2a6cd5
children 8dd4672b9f74
comparison
equal deleted inserted replaced
2452:73a66a4a6ab4 2453:f67b63ed036d
585 int ret; 585 int ret;
586 586
587 *got_picture_ptr= 0; 587 *got_picture_ptr= 0;
588 if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height)) 588 if((avctx->coded_width||avctx->coded_height) && avcodec_check_dimensions(avctx,avctx->coded_width,avctx->coded_height))
589 return -1; 589 return -1;
590 ret = avctx->codec->decode(avctx, picture, got_picture_ptr, 590 if((avctx->codec->capabilities & CODEC_CAP_DELAY) || buf_size){
591 buf, buf_size); 591 ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
592 592 buf, buf_size);
593 emms_c(); //needed to avoid a emms_c() call before every return; 593
594 594 emms_c(); //needed to avoid a emms_c() call before every return;
595 if (*got_picture_ptr) 595
596 avctx->frame_number++; 596 if (*got_picture_ptr)
597 avctx->frame_number++;
598 }else
599 ret= 0;
600
597 return ret; 601 return ret;
598 } 602 }
599 603
600 /* decode an audio frame. return -1 if error, otherwise return the 604 /* decode an audio frame. return -1 if error, otherwise return the
601 *number of bytes used. If no frame could be decompressed, 605 *number of bytes used. If no frame could be decompressed,