Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Aug 2011 21:32:51 +0000 (23:32 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 19 Aug 2011 21:32:51 +0000 (23:32 +0200)
* qatar/master:
  avconv: Set error code before before jumping to fail.
  h264: fix PCM intra-coded blocks in monochrome case

Conflicts:
libavcodec/h264.c

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

diff --cc avconv.c
+++ b/avconv.c
@@@ -1993,27 -1936,19 +1995,29 @@@ static int transcode(OutputFile *output
              codec->rc_max_rate    = icodec->rc_max_rate;
              codec->rc_buffer_size = icodec->rc_buffer_size;
              codec->extradata= av_mallocz(extra_size);
-             if (!codec->extradata)
+             if (!codec->extradata) {
+                 ret = AVERROR(ENOMEM);
                  goto fail;
+             }
              memcpy(codec->extradata, icodec->extradata, icodec->extradata_size);
              codec->extradata_size= icodec->extradata_size;
 -            if(!copy_tb && av_q2d(icodec->time_base)*icodec->ticks_per_frame > av_q2d(ist->st->time_base) && av_q2d(ist->st->time_base) < 1.0/500){
 -                codec->time_base = icodec->time_base;
 -                codec->time_base.num *= icodec->ticks_per_frame;
 -                av_reduce(&codec->time_base.num, &codec->time_base.den,
 -                          codec->time_base.num, codec->time_base.den, INT_MAX);
 -            }else
 -                codec->time_base = ist->st->time_base;
 +
 +            codec->time_base = ist->st->time_base;
 +            if(!strcmp(os->oformat->name, "avi")) {
 +                if(!copy_tb && av_q2d(icodec->time_base)*icodec->ticks_per_frame > 2*av_q2d(ist->st->time_base) && av_q2d(ist->st->time_base) < 1.0/500){
 +                    codec->time_base = icodec->time_base;
 +                    codec->time_base.num *= icodec->ticks_per_frame;
 +                    codec->time_base.den *= 2;
 +                }
 +            } else if(!(os->oformat->flags & AVFMT_VARIABLE_FPS)) {
 +                if(!copy_tb && av_q2d(icodec->time_base)*icodec->ticks_per_frame > av_q2d(ist->st->time_base) && av_q2d(ist->st->time_base) < 1.0/500){
 +                    codec->time_base = icodec->time_base;
 +                    codec->time_base.num *= icodec->ticks_per_frame;
 +                }
 +            }
 +            av_reduce(&codec->time_base.num, &codec->time_base.den,
 +                        codec->time_base.num, codec->time_base.den, INT_MAX);
 +
              switch(codec->codec_type) {
              case AVMEDIA_TYPE_AUDIO:
                  if(audio_volume != 256) {