mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-31 20:42:49 +08:00 
			
		
		
		
	Check for avio fail in avformat_write_header, av_write_frame
With minor changes by michael Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		 Andrey Utkin
					Andrey Utkin
				
			
				
					committed by
					
						 Michael Niedermayer
						Michael Niedermayer
					
				
			
			
				
	
			
			
			 Michael Niedermayer
						Michael Niedermayer
					
				
			
						parent
						
							7427d1ca4a
						
					
				
				
					commit
					aec9390a9d
				
			| @@ -3379,6 +3379,8 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options) | |||||||
|  |  | ||||||
|     if(s->oformat->write_header){ |     if(s->oformat->write_header){ | ||||||
|         ret = s->oformat->write_header(s); |         ret = s->oformat->write_header(s); | ||||||
|  |         if (ret >= 0 && s->pb && s->pb->error < 0) | ||||||
|  |             ret = s->pb->error; | ||||||
|         if (ret < 0) |         if (ret < 0) | ||||||
|             goto fail; |             goto fail; | ||||||
|     } |     } | ||||||
| @@ -3503,8 +3505,12 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) | |||||||
|     int ret; |     int ret; | ||||||
|  |  | ||||||
|     if (!pkt) { |     if (!pkt) { | ||||||
|         if (s->oformat->flags & AVFMT_ALLOW_FLUSH) |         if (s->oformat->flags & AVFMT_ALLOW_FLUSH) { | ||||||
|             return s->oformat->write_packet(s, pkt); |             ret = s->oformat->write_packet(s, pkt); | ||||||
|  |             if (ret >= 0 && s->pb && s->pb->error < 0) | ||||||
|  |                 ret = s->pb->error; | ||||||
|  |             return ret; | ||||||
|  |         } | ||||||
|         return 1; |         return 1; | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -3514,6 +3520,8 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) | |||||||
|         return ret; |         return ret; | ||||||
|  |  | ||||||
|     ret= s->oformat->write_packet(s, pkt); |     ret= s->oformat->write_packet(s, pkt); | ||||||
|  |     if (ret >= 0 && s->pb && s->pb->error < 0) | ||||||
|  |         ret = s->pb->error; | ||||||
|  |  | ||||||
|     if (ret >= 0) |     if (ret >= 0) | ||||||
|         s->streams[pkt->stream_index]->nb_frames++; |         s->streams[pkt->stream_index]->nb_frames++; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user