Merge commit '1e0b81abe86dc09dd34d60d57f92de5f12d65818'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 30 Oct 2014 01:36:53 +0000 (02:36 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 30 Oct 2014 01:37:03 +0000 (02:37 +0100)
* commit '1e0b81abe86dc09dd34d60d57f92de5f12d65818':
  movenc: Use a local variable consistently

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

@@@ -4816,21 -3766,9 +4816,21 @@@ static int mov_write_trailer(AVFormatCo
              av_log(s, AV_LOG_INFO, "Starting second pass: moving the moov atom to the beginning of the file\n");
              res = shift_data(s);
              if (res == 0) {
-                 avio_seek(s->pb, mov->reserved_moov_pos, SEEK_SET);
+                 avio_seek(pb, mov->reserved_moov_pos, SEEK_SET);
                  mov_write_moov_tag(pb, mov, s);
              }
 +        } else if (mov->reserved_moov_size > 0) {
 +            int64_t size;
 +            mov_write_moov_tag(pb, mov, s);
 +            size = mov->reserved_moov_size - (avio_tell(pb) - mov->reserved_moov_pos);
 +            if (size < 8){
 +                av_log(s, AV_LOG_ERROR, "reserved_moov_size is too small, needed %"PRId64" additional\n", 8-size);
 +                return -1;
 +            }
 +            avio_wb32(pb, size);
 +            ffio_wfourcc(pb, "free");
 +            ffio_fill(pb, 0, size - 8);
 +            avio_seek(pb, moov_pos, SEEK_SET);
          } else {
              mov_write_moov_tag(pb, mov, s);
          }