static const char* context_to_name(void* ptr) {
AVCodecContext *avc= ptr;
- if(avc && avc->codec && avc->codec->name)
+ if (avc && avc->codec)
return avc->codec->name;
else
return "NULL";
s->reordered_opaque = AV_NOPTS_VALUE;
if(codec && codec->priv_data_size){
- if(!s->priv_data){
- s->priv_data= av_mallocz(codec->priv_data_size);
- if (!s->priv_data) {
- return AVERROR(ENOMEM);
- }
- }
+ s->priv_data = av_mallocz(codec->priv_data_size);
+ if (!s->priv_data)
+ return AVERROR(ENOMEM);
if(codec->priv_class){
*(const AVClass**)s->priv_data = codec->priv_class;
av_opt_set_defaults(s->priv_data);