Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 24 Jun 2013 09:42:42 +0000 (11:42 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 24 Jun 2013 09:42:42 +0000 (11:42 +0200)
* qatar/master:
  lavf: don't abort if both encoder and muxer aspect ratios are not set

Conflicts:
libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/mux.c

@@@ -270,16 -184,21 +270,21 @@@ static int init_muxer(AVFormatContext *
                  ret = AVERROR(EINVAL);
                  goto fail;
              }
 -
 -            if (av_cmp_q(st->sample_aspect_ratio,
 -                         codec->sample_aspect_ratio)) {
 +            if (av_cmp_q(st->sample_aspect_ratio, codec->sample_aspect_ratio)
 +                && FFABS(av_q2d(st->sample_aspect_ratio) - av_q2d(codec->sample_aspect_ratio)) > 0.004*av_q2d(st->sample_aspect_ratio)
 +            ) {
-                 av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "
-                                         "(%d/%d) and encoder layer (%d/%d)\n",
-                        st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
-                        codec->sample_aspect_ratio.num,
-                        codec->sample_aspect_ratio.den);
-                 ret = AVERROR(EINVAL);
-                 goto fail;
+                 if (st->sample_aspect_ratio.num != 0 &&
+                     st->sample_aspect_ratio.den != 0 &&
+                     codec->sample_aspect_ratio.den != 0 &&
+                     codec->sample_aspect_ratio.den != 0) {
+                     av_log(s, AV_LOG_ERROR, "Aspect ratio mismatch between muxer "
 -                            "(%d/%d) and encoder layer (%d/%d)\n",
 -                            st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
 -                            codec->sample_aspect_ratio.num,
 -                            codec->sample_aspect_ratio.den);
++                           "(%d/%d) and encoder layer (%d/%d)\n",
++                           st->sample_aspect_ratio.num, st->sample_aspect_ratio.den,
++                           codec->sample_aspect_ratio.num,
++                           codec->sample_aspect_ratio.den);
+                     ret = AVERROR(EINVAL);
+                     goto fail;
+                 }
              }
              break;
          }