1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

data_size = 0 cleanup

Originally committed as revision 3146 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2004-05-21 14:37:16 +00:00
parent 5da42be192
commit 53db1cae1c
30 changed files with 2 additions and 57 deletions

View File

@ -600,8 +600,6 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame *p, temp;
int i, frame_4cc, frame_size;
*data_size = 0;
/* special case for last picture */
if (buf_size == 0) {
return 0;

View File

@ -160,7 +160,6 @@ static int a52_decode_frame(AVCodecContext *avctx,
2, 1, 2, 3, 3, 4, 4, 5
};
*data_size = 0;
buf_ptr = buf;
while (buf_size > 0) {
len = s->inbuf_ptr - s->inbuf;

View File

@ -92,7 +92,6 @@ static int ac3_decode_frame(AVCodecContext *avctx,
2, 1, 2, 3, 3, 4, 4, 5
};
*data_size = 0;
buf_ptr = buf;
while (buf_size > 0) {
len = s->inbuf_ptr - s->inbuf;

View File

@ -568,7 +568,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
if(st) { /* handle stereo interlacing */
c->channel = (channel + 1) % 2; /* we get one packet for left, then one for right data */
if(channel == 1) { /* wait for the other packet before outputing anything */
*data_size = 0;
return src - buf;
}
}
@ -842,7 +841,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
break;
default:
*data_size = 0;
return -1;
}
*data_size = (uint8_t *)samples - (uint8_t *)data;

View File

@ -221,7 +221,6 @@ static int amr_nb_decode_frame(AVCodecContext * avctx,
Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */
Word16 *synth;
UWord8 *packed_bits;
*data_size=0;
static Word16 packed_size[16] = {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0};
int i;
@ -416,7 +415,6 @@ static int amr_nb_decode_frame(AVCodecContext * avctx,
static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
enum Mode dec_mode;
int packet_size;
*data_size=0;
//printf("amr_decode_frame data_size=%i buf=0x%X buf_size=%d frameCount=%d!!\n",*data_size,buf,buf_size,s->frameCount);
@ -603,7 +601,6 @@ static int amr_wb_decode_frame(AVCodecContext * avctx,
int offset=0;
int mode;
int packet_size;
*data_size=0;
while(offset<buf_size)
{

View File

@ -403,8 +403,6 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame * const p= (AVFrame*)&a->picture;
int mb_x, mb_y;
*data_size = 0;
/* special case for last picture */
if (buf_size == 0) {
return 0;

View File

@ -43,8 +43,6 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame * const p= (AVFrame*)&a->picture;
int x, y;
*data_size = 0;
/* special case for last picture */
if (buf_size == 0) {
return 0;

View File

@ -81,8 +81,6 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
unsigned char cur_byte;
int pixel_groups;
*data_size = 0;
/* sanity check the buffer size: A buffer has 3x16-bytes tables
* followed by (height) lines each with 3 bytes to represent groups
* of 4 pixels. Thus, the total size of the buffer ought to be:

View File

@ -889,7 +889,6 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
{
DVVideoContext *s = avctx->priv_data;
*data_size=0;
/* special case for last picture */
if(buf_size==0)
return 0;

View File

@ -941,8 +941,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
AVFrame *picture = data;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0)
return 0;

View File

@ -546,8 +546,6 @@ static int flac_decode_frame(AVCodecContext *avctx,
int tmp = 0, i, j = 0, input_buf_size;
int16_t *samples = data, *left, *right;
*data_size = 0;
s->avctx = avctx;
if(s->max_framesize == 0){

View File

@ -417,8 +417,6 @@ uint64_t time= rdtsc();
s->flags= avctx->flags;
s->flags2= avctx->flags2;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0) {
/* special case for last picture */

View File

@ -5713,8 +5713,6 @@ static int decode_frame(AVCodecContext *avctx,
s->flags= avctx->flags;
s->flags2= avctx->flags2;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0) {
return 0;

View File

@ -684,8 +684,6 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
AVFrame *picture = data;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0)
return 0;

View File

@ -1058,7 +1058,6 @@ static int indeo3_decode_frame(AVCodecContext *avctx,
/* no supplementary picture */
if (buf_size == 0) {
*data_size = 0;
return 0;
}

View File

@ -421,7 +421,6 @@ puts("mace_decode_frame[6]()");
*data_size = 2 * 6 * buf_size;
break;
default:
*data_size = 0;
return -1;
}
return buf_size;

View File

@ -1724,8 +1724,6 @@ static int mjpeg_decode_frame(AVCodecContext *avctx,
int start_code;
AVFrame *picture = data;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0)
return 0;
@ -1902,8 +1900,6 @@ static int mjpegb_decode_frame(AVCodecContext *avctx,
uint32_t dqt_offs, dht_offs, sof_offs, sos_offs, second_field_offs;
uint32_t field_size;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0)
return 0;
@ -2015,8 +2011,6 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
uint8_t *buf_ptr, *buf_end, *recoded;
int i = 0, j = 0;
*data_size = 0;
/* no supplementary picture */
if (buf_size == 0)
return 0;

View File

@ -2791,8 +2791,6 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
MpegEncContext *s2 = &s->mpeg_enc_ctx;
dprintf("fill_buffer\n");
*data_size = 0;
/* special case for last picture */
if (buf_size == 0 && s2->low_delay==0 && s2->next_picture_ptr) {
*picture= *(AVFrame*)s2->next_picture_ptr;

View File

@ -2520,7 +2520,6 @@ static int decode_frame(AVCodecContext * avctx,
int len, out_size;
short *out_samples = data;
*data_size = 0;
buf_ptr = buf;
while (buf_size > 0) {
len = s->inbuf_ptr - s->inbuf;

View File

@ -264,7 +264,6 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext,
if(!buf_size){
//FIXME flush
*data_size=0;
return 0;
}

View File

@ -118,7 +118,6 @@ static int raw_decode(AVCodecContext *avctx,
if (buf_size < bytesNeeded) {
memcpy(context->p, buf, buf_size);
context->p += buf_size;
*data_size = 0;
return buf_size;
}

View File

@ -450,8 +450,6 @@ static int roq_decode_frame(AVCodecContext *avctx,
{
RoqContext *s = avctx->priv_data;
*data_size = 0;
if (avctx->get_buffer(avctx, &s->current_frame)) {
av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
return -1;

View File

@ -651,7 +651,6 @@ static int rv10_decode_frame(AVCodecContext *avctx,
/* no supplementary picture */
if (buf_size == 0) {
*data_size = 0;
return 0;
}
@ -685,8 +684,6 @@ static int rv10_decode_frame(AVCodecContext *avctx,
}
*data_size = sizeof(AVFrame);
}else{
*data_size = 0;
}
return buf_size;

View File

@ -600,7 +600,6 @@ static uint16_t svq1_packet_checksum (uint8_t *data, int length, int value) {
return value;
}
#if 0
static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
int width, int height, int value) {
int x, y;
@ -615,7 +614,6 @@ static uint16_t svq1_component_checksum (uint16_t *pixels, int pitch,
return value;
}
#endif
static void svq1_parse_string (GetBitContext *bitbuf, uint8_t *out) {
uint8_t seed;
@ -715,8 +713,6 @@ static int svq1_decode_frame(AVCodecContext *avctx,
int result, i, x, y, width, height;
AVFrame *pict = data;
*data_size=0;
if(buf==NULL && buf_size==0){
return 0;
}

View File

@ -769,8 +769,6 @@ static int svq3_decode_frame (AVCodecContext *avctx,
unsigned char *extradata;
unsigned int size;
*data_size = 0;
s->flags = avctx->flags;
s->flags2 = avctx->flags2;
s->unrestricted_mv = 1;

View File

@ -547,8 +547,6 @@ static int truemotion1_decode_frame(AVCodecContext *avctx,
if (buf_size == 0)
return 0;
*data_size = 0;
if (truemotion1_decode_header(s) == -1)
return -1;

View File

@ -488,6 +488,7 @@ int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,
{
int ret;
*got_picture_ptr= 0;
ret = avctx->codec->decode(avctx, picture, got_picture_ptr,
buf, buf_size);
@ -508,6 +509,7 @@ int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,
{
int ret;
*frame_size_ptr= 0;
ret = avctx->codec->decode(avctx, samples, frame_size_ptr,
buf, buf_size);
avctx->frame_number++;

View File

@ -45,8 +45,6 @@ static int decode_frame(AVCodecContext *avctx,
uint8_t *bytestream= buf;
int i, x, y;
*data_size = 0;
/* special case for last picture */
if (buf_size == 0) {
return 0;

View File

@ -522,7 +522,6 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
if (buf_size < 16)
return buf_size;
*data_size = 0;
if (buf[6] == 1) {
/* the chunk contains audio */
*data_size = vmdaudio_loadsound(s, output_samples, p, 0);

View File

@ -2474,8 +2474,6 @@ static int vp3_decode_frame(AVCodecContext *avctx,
GetBitContext gb;
static int counter = 0;
*data_size = 0;
init_get_bits(&gb, buf, buf_size * 8);
if (s->theora && get_bits1(&gb))