comparison utils.c @ 12134:cb3eb3a2fc96 libavcodec

Add avsubtitle_free function.
author reimar
date Sun, 11 Jul 2010 07:35:00 +0000
parents c35d7bc64882
children b8a0924d6e42
comparison
equal deleted inserted replaced
12133:24649290a14f 12134:cb3eb3a2fc96
685 *got_sub_ptr = 0; 685 *got_sub_ptr = 0;
686 ret = avctx->codec->decode(avctx, sub, got_sub_ptr, avpkt); 686 ret = avctx->codec->decode(avctx, sub, got_sub_ptr, avpkt);
687 if (*got_sub_ptr) 687 if (*got_sub_ptr)
688 avctx->frame_number++; 688 avctx->frame_number++;
689 return ret; 689 return ret;
690 }
691
692 void avsubtitle_free(AVSubtitle *sub)
693 {
694 int i;
695
696 for (i = 0; i < sub->num_rects; i++)
697 {
698 av_freep(sub->rects[i]->pict.data[0]);
699 av_freep(sub->rects[i]->pict.data[1]);
700 av_freep(sub->rects[i]->pict.data[2]);
701 av_freep(sub->rects[i]->pict.data[3]);
702 av_freep(sub->rects[i]->text);
703 av_freep(sub->rects[i]->ass);
704 av_freep(sub->rects[i]);
705 }
706
707 av_freep(sub->rects);
708
709 memset(sub, 0, sizeof(AVSubtitle));
690 } 710 }
691 711
692 av_cold int avcodec_close(AVCodecContext *avctx) 712 av_cold int avcodec_close(AVCodecContext *avctx)
693 { 713 {
694 /* If there is a user-supplied mutex locking routine, call it. */ 714 /* If there is a user-supplied mutex locking routine, call it. */