Do not free sps & pps on width/height changes.
Fixes issue557. Originally committed as revision 15414 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							parent
							
								
									fe67a236dd
								
							
						
					
					
						commit
						5f129a05bf
					
				| @ -2034,12 +2034,6 @@ static void free_tables(H264Context *h){ | |||||||
|     av_freep(&h->mb2b_xy); |     av_freep(&h->mb2b_xy); | ||||||
|     av_freep(&h->mb2b8_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++) { |     for(i = 0; i < h->s.avctx->thread_count; i++) { | ||||||
|         hx = h->thread_context[i]; |         hx = h->thread_context[i]; | ||||||
|         if(!hx) continue; |         if(!hx) continue; | ||||||
| @ -7920,10 +7914,18 @@ static av_cold int decode_end(AVCodecContext *avctx) | |||||||
| { | { | ||||||
|     H264Context *h = avctx->priv_data; |     H264Context *h = avctx->priv_data; | ||||||
|     MpegEncContext *s = &h->s; |     MpegEncContext *s = &h->s; | ||||||
|  |     int i; | ||||||
| 
 | 
 | ||||||
|     av_freep(&h->rbsp_buffer[0]); |     av_freep(&h->rbsp_buffer[0]); | ||||||
|     av_freep(&h->rbsp_buffer[1]); |     av_freep(&h->rbsp_buffer[1]); | ||||||
|     free_tables(h); //FIXME cleanup init stuff perhaps
 |     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); |     MPV_common_end(s); | ||||||
| 
 | 
 | ||||||
| //    memset(h, 0, sizeof(H264Context));
 | //    memset(h, 0, sizeof(H264Context));
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user