avformat/mpegts: fix resync seek
The seek ended up seeking before the begin, which caused problems
Fixes initial sync issues with libbluray
Fixes Ticket3117
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7d0e927a31)
			
			
This commit is contained in:
		
				
					committed by
					
						
						Carl Eugen Hoyos
					
				
			
			
				
	
			
			
			
						parent
						
							842def7d78
						
					
				
				
					commit
					a289b0b91a
				
			@@ -1976,7 +1976,9 @@ static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size, co
 | 
				
			|||||||
        /* check packet sync byte */
 | 
					        /* check packet sync byte */
 | 
				
			||||||
        if ((*data)[0] != 0x47) {
 | 
					        if ((*data)[0] != 0x47) {
 | 
				
			||||||
            /* find a new packet start */
 | 
					            /* find a new packet start */
 | 
				
			||||||
            avio_seek(pb, -raw_packet_size, SEEK_CUR);
 | 
					            uint64_t pos = avio_tell(pb);
 | 
				
			||||||
 | 
					            avio_seek(pb, -FFMIN(raw_packet_size, pos), SEEK_CUR);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (mpegts_resync(s) < 0)
 | 
					            if (mpegts_resync(s) < 0)
 | 
				
			||||||
                return AVERROR(EAGAIN);
 | 
					                return AVERROR(EAGAIN);
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user