avformat/adp, svs: Remove redundant av_shrink_packet()
av_get_packet() already makes sure that the packet size is accurate and that the packet data is zero-padded even when one could not read as much as desired. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
		
							parent
							
								
									51367267c8
								
							
						
					
					
						commit
						d025a5bcc2
					
				@ -75,13 +75,9 @@ static int adp_read_packet(AVFormatContext *s, AVPacket *pkt)
 | 
			
		||||
        return AVERROR_EOF;
 | 
			
		||||
 | 
			
		||||
    ret = av_get_packet(s->pb, pkt, size);
 | 
			
		||||
 | 
			
		||||
    if (ret != size) {
 | 
			
		||||
        if (ret < 0) {
 | 
			
		||||
    if (ret < 0)
 | 
			
		||||
        return ret;
 | 
			
		||||
        }
 | 
			
		||||
        av_shrink_packet(pkt, ret);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    pkt->stream_index = 0;
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
 | 
			
		||||
@ -79,7 +79,6 @@ static int svs_read_packet(AVFormatContext *s, AVPacket *pkt)
 | 
			
		||||
    if (ret != 32 * 256) {
 | 
			
		||||
        if (ret < 0)
 | 
			
		||||
            return ret;
 | 
			
		||||
        av_shrink_packet(pkt, ret);
 | 
			
		||||
        pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
 | 
			
		||||
    }
 | 
			
		||||
    pkt->stream_index = 0;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user