}
avctx->frame_number = 0;
if(avctx->codec->init){
+ if(avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
+ avctx->codec->max_lowres < avctx->lowres){
+ av_log(avctx, AV_LOG_ERROR, "The maximum value for lowres supported by the decoder is %d\n",
+ avctx->codec->max_lowres);
+ goto free_and_end;
+ }
+
ret = avctx->codec->init(avctx);
if (ret < 0) {
goto free_and_end;
return ret;
}
+void avsubtitle_free(AVSubtitle *sub)
+{
+ int i;
+
+ for (i = 0; i < sub->num_rects; i++)
+ {
+ av_freep(sub->rects[i]->pict.data[0]);
+ av_freep(sub->rects[i]->pict.data[1]);
+ av_freep(sub->rects[i]->pict.data[2]);
+ av_freep(sub->rects[i]->pict.data[3]);
+ av_freep(sub->rects[i]->text);
+ av_freep(sub->rects[i]->ass);
+ av_freep(sub->rects[i]);
+ }
+
+ av_freep(sub->rects);
+
+ memset(sub, 0, sizeof(AVSubtitle));
+}
+
av_cold int avcodec_close(AVCodecContext *avctx)
{
/* If there is a user-supplied mutex locking routine, call it. */