aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-25 19:01:39 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-25 19:01:39 +0000
commit5f129a05bf69d5655ae6d6ea82ca1a97f0b1913f (patch)
tree27b5bdfc3c8bd5c4c5e7304875dc94f9104cc6f1
parentfe67a236dd97a20478f1b71d255e64d202287ecc (diff)
downloadffmpeg-5f129a05bf69d5655ae6d6ea82ca1a97f0b1913f.tar.gz
Do not free sps & pps on width/height changes.
Fixes issue557. Originally committed as revision 15414 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h264.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index d2daba1f66..c4a452810b 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2034,12 +2034,6 @@ static void free_tables(H264Context *h){
av_freep(&h->mb2b_xy);
av_freep(&h->mb2b8_xy);
- for(i = 0; i < MAX_SPS_COUNT; i++)
- av_freep(h->sps_buffers + i);
-
- for(i = 0; i < MAX_PPS_COUNT; i++)
- av_freep(h->pps_buffers + i);
-
for(i = 0; i < h->s.avctx->thread_count; i++) {
hx = h->thread_context[i];
if(!hx) continue;
@@ -7920,10 +7914,18 @@ static av_cold int decode_end(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
MpegEncContext *s = &h->s;
+ int i;
av_freep(&h->rbsp_buffer[0]);
av_freep(&h->rbsp_buffer[1]);
free_tables(h); //FIXME cleanup init stuff perhaps
+
+ for(i = 0; i < MAX_SPS_COUNT; i++)
+ av_freep(h->sps_buffers + i);
+
+ for(i = 0; i < MAX_PPS_COUNT; i++)
+ av_freep(h->pps_buffers + i);
+
MPV_common_end(s);
// memset(h, 0, sizeof(H264Context));