You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avformat/mux: Remove redundant checks for write errors
If writing a packet didn't directly return an error, the AVIOContext's error flag is checked for errors (if existing) by write_packet(). And if write_packet() didn't indicate an error, its callers checked the error flag of the AVIOContext (if existing). The latter check is redundant. The reason for checking twice lies in the FFmpeg-Libav split: The check in write_packet() has been added in9ad1e0c1in Libav. FFmpeg already had the other checks (sinceaec9390a), but when9ad1e0c1was merged (in1f1c1008), no one noticed the redundant checks. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		
				
					committed by
					
						 Michael Niedermayer
						Michael Niedermayer
					
				
			
			
				
	
			
			
			
						parent
						
							cc2a9509ce
						
					
				
				
					commit
					5c5ab88967
				
			| @@ -913,8 +913,6 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) | ||||
| #endif | ||||
|  | ||||
|     ret = write_packet(s, pkt); | ||||
|     if (ret >= 0 && s->pb && s->pb->error < 0) | ||||
|         ret = s->pb->error; | ||||
|  | ||||
|     if (ret >= 0) | ||||
|         s->streams[pkt->stream_index]->nb_frames++; | ||||
| @@ -1246,8 +1244,6 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt) | ||||
|  | ||||
|         if (ret < 0) | ||||
|             return ret; | ||||
|         if(s->pb && s->pb->error) | ||||
|             return s->pb->error; | ||||
|     } | ||||
| fail: | ||||
|     av_packet_unref(pkt); | ||||
| @@ -1274,8 +1270,6 @@ int av_write_trailer(AVFormatContext *s) | ||||
|  | ||||
|         if (ret < 0) | ||||
|             goto fail; | ||||
|         if(s->pb && s->pb->error) | ||||
|             goto fail; | ||||
|     } | ||||
|  | ||||
| fail: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user