Revision c04c3282

View differences:

libavformat/audio.c
217 217
    AVStream *st;
218 218
    int ret;
219 219

  
220
    if (!ap || ap->sample_rate <= 0 || ap->channels <= 0)
220
    if (ap->sample_rate <= 0 || ap->channels <= 0)
221 221
        return -1;
222 222

  
223 223
    st = av_new_stream(s1, 0);
libavformat/grab.c
68 68
    const char *video_device;
69 69
    int j;
70 70

  
71
    if (!ap || ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0)
71
    if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0)
72 72
        return -1;
73 73

  
74 74
    width = ap->width;
libavformat/grab_bktr.c
245 245
    int format = -1;
246 246
    const char *video_device;
247 247

  
248
    if (!ap || ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0)
248
    if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0)
249 249
        return -1;
250 250

  
251 251
    width = ap->width;
libavformat/img.c
120 120
        return -ENOMEM;
121 121
    }
122 122

  
123
    if (ap && ap->image_format)
123
    if (ap->image_format)
124 124
        s->img_fmt = ap->image_format;
125 125

  
126 126
    pstrcpy(s->path, sizeof(s->path), s1->filename);
......
133 133
    else
134 134
        s->is_pipe = 1;
135 135

  
136
    if (!ap || !ap->time_base.num) {
136
    if (!ap->time_base.num) {
137 137
        st->codec->time_base= (AVRational){1,25};
138 138
    } else {
139 139
        st->codec->time_base= ap->time_base;
......
255 255
    int i;
256 256

  
257 257
    /* find output image format */
258
    if (ap && ap->image_format) {
258
    if (ap->image_format) {
259 259
        img_fmt = ap->image_format;
260 260
    } else {
261 261
        img_fmt = guess_image_format(s->filename);
libavformat/img2.c
187 187
        st->need_parsing= 1;
188 188
    }
189 189

  
190
    if (!ap || !ap->time_base.num) {
190
    if (!ap->time_base.num) {
191 191
        av_set_pts_info(st, 60, 1, 25);
192 192
    } else {
193 193
        av_set_pts_info(st, 60, ap->time_base.num, ap->time_base.den);
194 194
    }
195 195

  
196
    if(ap && ap->width && ap->height){
196
    if(ap->width && ap->height){
197 197
        st->codec->width = ap->width;
198 198
        st->codec->height= ap->height;
199 199
    }
libavformat/raw.c
48 48
    st = av_new_stream(s, 0);
49 49
    if (!st)
50 50
        return AVERROR_NOMEM;
51
    if (ap) {
51

  
52 52
        id = s->iformat->value;
53 53
        if (id == CODEC_ID_RAWVIDEO) {
54 54
            st->codec->codec_type = CODEC_TYPE_VIDEO;
......
74 74
        default:
75 75
            return -1;
76 76
        }
77
    } else {
78
        return -1;
79
    }
80 77
    return 0;
81 78
}
82 79

  
......
289 286

  
290 287
    /* for mjpeg, specify frame rate */
291 288
    /* for mpeg4 specify it too (most mpeg4 streams dont have the fixed_vop_rate set ...)*/
292
    if (ap && ap->time_base.num) {
289
    if (ap->time_base.num) {
293 290
        av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
294 291
    } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
295 292
                st->codec->codec_id == CODEC_ID_MPEG4 ||
libavformat/rtsp.c
994 994
    rt->state = RTSP_STATE_IDLE;
995 995
    rt->seek_timestamp = 0; /* default is to start stream at position
996 996
                               zero */
997
    if (ap && ap->initial_pause) {
997
    if (ap->initial_pause) {
998 998
        /* do not start immediately */
999 999
    } else {
1000 1000
        if (rtsp_read_play(s) < 0) {
libavformat/utils.c
465 465
{
466 466
    int err;
467 467
    AVFormatContext *ic;
468
    AVFormatParameters default_ap;
469

  
470
    if(!ap){
471
        ap=&default_ap;
472
        memset(ap, 0, sizeof(default_ap));
473
    }
468 474

  
469 475
    ic = av_alloc_format_context();
470 476
    if (!ic) {
libavformat/v4l2.c
384 384
    uint32_t desired_format, capabilities;
385 385
    const char *video_device;
386 386

  
387
    if (!ap || ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) {
387
    if (ap->width <= 0 || ap->height <= 0 || ap->time_base.den <= 0) {
388 388
        av_log(s1, AV_LOG_ERROR, "Missing/Wrong parameters\n");
389 389

  
390 390
        return -1;

Also available in: Unified diff