Mercurial > libavformat.hg
comparison img.c @ 1003:2d57ce58f576 libavformat
simplify AVFormatParameters NULL checks
author | michael |
---|---|
date | Sat, 11 Mar 2006 00:22:21 +0000 |
parents | edbe5c3717f9 |
children | 5c750fb6b8cc |
comparison
equal
deleted
inserted
replaced
1002:56db80b1131e | 1003:2d57ce58f576 |
---|---|
118 if (!st) { | 118 if (!st) { |
119 av_free(s); | 119 av_free(s); |
120 return -ENOMEM; | 120 return -ENOMEM; |
121 } | 121 } |
122 | 122 |
123 if (ap && ap->image_format) | 123 if (ap->image_format) |
124 s->img_fmt = ap->image_format; | 124 s->img_fmt = ap->image_format; |
125 | 125 |
126 pstrcpy(s->path, sizeof(s->path), s1->filename); | 126 pstrcpy(s->path, sizeof(s->path), s1->filename); |
127 s->img_number = 0; | 127 s->img_number = 0; |
128 s->img_count = 0; | 128 s->img_count = 0; |
131 if (s1->iformat->flags & AVFMT_NOFILE) | 131 if (s1->iformat->flags & AVFMT_NOFILE) |
132 s->is_pipe = 0; | 132 s->is_pipe = 0; |
133 else | 133 else |
134 s->is_pipe = 1; | 134 s->is_pipe = 1; |
135 | 135 |
136 if (!ap || !ap->time_base.num) { | 136 if (!ap->time_base.num) { |
137 st->codec->time_base= (AVRational){1,25}; | 137 st->codec->time_base= (AVRational){1,25}; |
138 } else { | 138 } else { |
139 st->codec->time_base= ap->time_base; | 139 st->codec->time_base= ap->time_base; |
140 } | 140 } |
141 | 141 |
253 AVStream *st; | 253 AVStream *st; |
254 AVImageFormat *img_fmt; | 254 AVImageFormat *img_fmt; |
255 int i; | 255 int i; |
256 | 256 |
257 /* find output image format */ | 257 /* find output image format */ |
258 if (ap && ap->image_format) { | 258 if (ap->image_format) { |
259 img_fmt = ap->image_format; | 259 img_fmt = ap->image_format; |
260 } else { | 260 } else { |
261 img_fmt = guess_image_format(s->filename); | 261 img_fmt = guess_image_format(s->filename); |
262 } | 262 } |
263 if (!img_fmt) | 263 if (!img_fmt) |