Revision e1745e2f

View differences:

libavformat/utils.c
2609 2609
    // some sanity checks
2610 2610
    if (s->nb_streams == 0) {
2611 2611
        av_log(s, AV_LOG_ERROR, "no streams\n");
2612
        return -1;
2612
        return AVERROR(EINVAL);
2613 2613
    }
2614 2614

  
2615 2615
    for(i=0;i<s->nb_streams;i++) {
......
2619 2619
        case AVMEDIA_TYPE_AUDIO:
2620 2620
            if(st->codec->sample_rate<=0){
2621 2621
                av_log(s, AV_LOG_ERROR, "sample rate not set\n");
2622
                return -1;
2622
                return AVERROR(EINVAL);
2623 2623
            }
2624 2624
            if(!st->codec->block_align)
2625 2625
                st->codec->block_align = st->codec->channels *
......
2628 2628
        case AVMEDIA_TYPE_VIDEO:
2629 2629
            if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too?
2630 2630
                av_log(s, AV_LOG_ERROR, "time base not set\n");
2631
                return -1;
2631
                return AVERROR(EINVAL);
2632 2632
            }
2633 2633
            if((st->codec->width<=0 || st->codec->height<=0) && !(s->oformat->flags & AVFMT_NODIMENSIONS)){
2634 2634
                av_log(s, AV_LOG_ERROR, "dimensions not set\n");
2635
                return -1;
2635
                return AVERROR(EINVAL);
2636 2636
            }
2637 2637
            if(av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)){
2638 2638
                av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between encoder and muxer layer\n");
2639
                return -1;
2639
                return AVERROR(EINVAL);
2640 2640
            }
2641 2641
            break;
2642 2642
        }

Also available in: Unified diff