comparison dv.c @ 1228:d63e0185a90f libavcodec

release buffer cleanup
author michaelni
date Tue, 06 May 2003 20:43:37 +0000
parents adcc6f345202
children b8e1c17b8d7d
comparison
equal deleted inserted replaced
1227:184c480cefc3 1228:d63e0185a90f
578 (apt == 1 && (buf[VAUX_TC61_OFFSET + 2] & 0x07) == 0x02))) 578 (apt == 1 && (buf[VAUX_TC61_OFFSET + 2] & 0x07) == 0x02)))
579 avctx->aspect_ratio = 16.0 / 9.0; 579 avctx->aspect_ratio = 16.0 / 9.0;
580 else 580 else
581 avctx->aspect_ratio = 4.0 / 3.0; 581 avctx->aspect_ratio = 4.0 / 3.0;
582 582
583 if(s->picture.data[0])
584 avctx->release_buffer(avctx, &s->picture);
585
583 s->picture.reference= 0; 586 s->picture.reference= 0;
584 if(avctx->get_buffer(avctx, &s->picture) < 0) { 587 if(avctx->get_buffer(avctx, &s->picture) < 0) {
585 fprintf(stderr, "get_buffer() failed\n"); 588 fprintf(stderr, "get_buffer() failed\n");
586 return -1; 589 return -1;
587 } 590 }
614 emms_c(); 617 emms_c();
615 618
616 /* return image */ 619 /* return image */
617 *data_size = sizeof(AVFrame); 620 *data_size = sizeof(AVFrame);
618 *(AVFrame*)data= s->picture; 621 *(AVFrame*)data= s->picture;
619
620 avctx->release_buffer(avctx, &s->picture);
621 622
622 return packet_size; 623 return packet_size;
623 } 624 }
624 625
625 static int dvvideo_decode_end(AVCodecContext *avctx) 626 static int dvvideo_decode_end(AVCodecContext *avctx)