avcodec/hevc: Remove current_sps

The variable should not be needed anymore

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/135/head
Michael Niedermayer 10 years ago
parent 2879a4ecb9
commit 0e7444f6e4
  1. 9
      libavcodec/hevc.c
  2. 2
      libavcodec/hevc.h
  3. 1
      libavcodec/hevc_parser.c
  4. 7
      libavcodec/hevc_ps.c

@ -3218,8 +3218,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
s->pps = NULL; s->pps = NULL;
s->vps = NULL; s->vps = NULL;
av_buffer_unref(&s->current_sps);
av_freep(&s->sh.entry_point_offset); av_freep(&s->sh.entry_point_offset);
av_freep(&s->sh.offset); av_freep(&s->sh.offset);
av_freep(&s->sh.size); av_freep(&s->sh.size);
@ -3340,13 +3338,6 @@ static int hevc_update_thread_context(AVCodecContext *dst,
} }
} }
av_buffer_unref(&s->current_sps);
if (s0->current_sps) {
s->current_sps = av_buffer_ref(s0->current_sps);
if (!s->current_sps)
return AVERROR(ENOMEM);
}
if (s->sps != s0->sps) if (s->sps != s0->sps)
if ((ret = set_sps(s, s0->sps, src->pix_fmt)) < 0) if ((ret = set_sps(s, s0->sps, src->pix_fmt)) < 0)
return ret; return ret;

@ -819,8 +819,6 @@ typedef struct HEVCContext {
AVBufferRef *sps_list[MAX_SPS_COUNT]; AVBufferRef *sps_list[MAX_SPS_COUNT];
AVBufferRef *pps_list[MAX_PPS_COUNT]; AVBufferRef *pps_list[MAX_PPS_COUNT];
AVBufferRef *current_sps;
AVBufferPool *tab_mvf_pool; AVBufferPool *tab_mvf_pool;
AVBufferPool *rpl_tab_pool; AVBufferPool *rpl_tab_pool;

@ -333,7 +333,6 @@ static void hevc_close(AVCodecParserContext *s)
for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++) for (i = 0; i < FF_ARRAY_ELEMS(h->pps_list); i++)
av_buffer_unref(&h->pps_list[i]); av_buffer_unref(&h->pps_list[i]);
av_buffer_unref(&h->current_sps);
h->sps = NULL; h->sps = NULL;
for (i = 0; i < h->nals_allocated; i++) for (i = 0; i < h->nals_allocated; i++)

@ -88,12 +88,7 @@ static void remove_sps(HEVCContext *s, int id)
if (s->pps_list[i] && ((HEVCPPS*)s->pps_list[i]->data)->sps_id == id) if (s->pps_list[i] && ((HEVCPPS*)s->pps_list[i]->data)->sps_id == id)
remove_pps(s, i); remove_pps(s, i);
if (s->sps_list[id] && s->sps == (HEVCSPS*)s->sps_list[id]->data) { av_assert0(!(s->sps_list[id] && s->sps == (HEVCSPS*)s->sps_list[id]->data));
av_buffer_unref(&s->current_sps);
s->current_sps = av_buffer_ref(s->sps_list[id]);
if (!s->current_sps)
s->sps = NULL;
}
} }
av_buffer_unref(&s->sps_list[id]); av_buffer_unref(&s->sps_list[id]);
} }

Loading…
Cancel
Save