mirror of
				https://git.ffmpeg.org/ffmpeg.git
				synced 2025-10-30 23:30:55 +00:00 
			
		
		
		
	lavc: factorize setting got_packet_ptr in avcodec_encode_video2()
This commit is contained in:
		
							parent
							
								
									52953d61ca
								
							
						
					
					
						commit
						d55fa6f9cb
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1093,10 +1093,11 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, | ||||||
|     int ret; |     int ret; | ||||||
|     int user_packet = !!avpkt->data; |     int user_packet = !!avpkt->data; | ||||||
| 
 | 
 | ||||||
|  |     *got_packet_ptr = 0; | ||||||
|  | 
 | ||||||
|     if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) { |     if (!(avctx->codec->capabilities & CODEC_CAP_DELAY) && !frame) { | ||||||
|         av_init_packet(avpkt); |         av_init_packet(avpkt); | ||||||
|         avpkt->size     = 0; |         avpkt->size     = 0; | ||||||
|         *got_packet_ptr = 0; |  | ||||||
|         return 0; |         return 0; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -1105,7 +1106,6 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx, | ||||||
| 
 | 
 | ||||||
|     av_assert0(avctx->codec->encode2); |     av_assert0(avctx->codec->encode2); | ||||||
| 
 | 
 | ||||||
|     *got_packet_ptr = 0; |  | ||||||
|     ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr); |     ret = avctx->codec->encode2(avctx, avpkt, frame, got_packet_ptr); | ||||||
|     if (!ret) { |     if (!ret) { | ||||||
|         if (!*got_packet_ptr) |         if (!*got_packet_ptr) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Anton Khirnov
						Anton Khirnov