Revision 7d727f13 ffmpeg.c

View differences:

ffmpeg.c
3779 3779
    if (!strcmp(filename, "-"))
3780 3780
        filename = "pipe:";
3781 3781

  
3782
    oc = avformat_alloc_context();
3782
    oc = avformat_alloc_output_context(last_asked_format, NULL, filename);
3783
    last_asked_format = NULL;
3783 3784
    if (!oc) {
3784 3785
        print_error(filename, AVERROR(ENOMEM));
3785 3786
        ffmpeg_exit(1);
3786 3787
    }
3787

  
3788
    if (last_asked_format) {
3789
        file_oformat = av_guess_format(last_asked_format, NULL, NULL);
3790
        if (!file_oformat) {
3791
            fprintf(stderr, "Requested output format '%s' is not a suitable output format\n", last_asked_format);
3792
            ffmpeg_exit(1);
3793
        }
3794
        last_asked_format = NULL;
3795
    } else {
3796
        file_oformat = av_guess_format(NULL, filename, NULL);
3797
        if (!file_oformat) {
3798
            fprintf(stderr, "Unable to find a suitable output format for '%s'\n",
3799
                    filename);
3800
            ffmpeg_exit(1);
3801
        }
3802
    }
3803

  
3804
    oc->oformat = file_oformat;
3805
    av_strlcpy(oc->filename, filename, sizeof(oc->filename));
3788
    file_oformat= oc->oformat;
3806 3789

  
3807 3790
    if (!strcmp(file_oformat->name, "ffm") &&
3808 3791
        av_strstart(filename, "http:", NULL)) {

Also available in: Unified diff