lavf: simplify format_child_class_next()
And fix the error introduced when adding private option to avio.
See 32caa7b13c
			
			
This commit is contained in:
		@@ -53,27 +53,30 @@ static const AVClass *format_child_class_next(const AVClass *prev)
 | 
				
			|||||||
    AVInputFormat  *ifmt = NULL;
 | 
					    AVInputFormat  *ifmt = NULL;
 | 
				
			||||||
    AVOutputFormat *ofmt = NULL;
 | 
					    AVOutputFormat *ofmt = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while (prev && (ifmt = av_iformat_next(ifmt)))
 | 
					    if (!prev)
 | 
				
			||||||
 | 
					#if !FF_API_OLD_AVIO
 | 
				
			||||||
 | 
					        return &ffio_url_class;
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    prev = (void *)&ifmt; // Dummy pointer;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    while ((ifmt = av_iformat_next(ifmt)))
 | 
				
			||||||
        if (ifmt->priv_class == prev)
 | 
					        if (ifmt->priv_class == prev)
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
    if ((prev && ifmt) || (!prev))
 | 
					
 | 
				
			||||||
 | 
					    if (!ifmt)
 | 
				
			||||||
 | 
					        while ((ofmt = av_oformat_next(ofmt)))
 | 
				
			||||||
 | 
					            if (ofmt->priv_class == prev)
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
 | 
					    if (!ofmt)
 | 
				
			||||||
        while (ifmt = av_iformat_next(ifmt))
 | 
					        while (ifmt = av_iformat_next(ifmt))
 | 
				
			||||||
            if (ifmt->priv_class)
 | 
					            if (ifmt->priv_class)
 | 
				
			||||||
                return ifmt->priv_class;
 | 
					                return ifmt->priv_class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while (prev && (ofmt = av_oformat_next(ofmt)))
 | 
					 | 
				
			||||||
        if (ofmt->priv_class == prev)
 | 
					 | 
				
			||||||
            break;
 | 
					 | 
				
			||||||
    if ((prev && ofmt) || (!prev))
 | 
					 | 
				
			||||||
    while (ofmt = av_oformat_next(ofmt))
 | 
					    while (ofmt = av_oformat_next(ofmt))
 | 
				
			||||||
        if (ofmt->priv_class)
 | 
					        if (ofmt->priv_class)
 | 
				
			||||||
            return ofmt->priv_class;
 | 
					            return ofmt->priv_class;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if !FF_API_OLD_AVIO
 | 
					 | 
				
			||||||
    if (prev != &ffio_url_class)
 | 
					 | 
				
			||||||
        return &ffio_url_class;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user