Merge commit '28c020d4df9b060a58a124a7a5406d4313fbe249'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 25 Oct 2014 02:45:23 +0000 (04:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 25 Oct 2014 02:45:23 +0000 (04:45 +0200)
* commit '28c020d4df9b060a58a124a7a5406d4313fbe249':
  matroskaenc: check avio_open_dyn_buf return value

Conflicts:
libavformat/matroskaenc.c

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

@@@ -1683,20 -1442,11 +1683,21 @@@ static int mkv_write_packet_internal(AV
      }
      ts += mkv->tracks[pkt->stream_index].ts_offset;
  
 +    if (mkv->cluster_pos != -1) {
 +        int64_t cluster_time = ts - mkv->cluster_pts + mkv->tracks[pkt->stream_index].ts_offset;
 +        if ((int16_t)cluster_time != cluster_time) {
 +            av_log(s, AV_LOG_WARNING, "Starting new cluster due to timestamp\n");
 +            mkv_start_new_cluster(s, pkt);
 +        }
 +    }
 +
      if (!s->pb->seekable) {
          if (!mkv->dyn_bc) {
-             if ((ret = avio_open_dyn_buf(&mkv->dyn_bc)) < 0) {
+             ret = avio_open_dyn_buf(&mkv->dyn_bc);
 -            if (ret < 0)
++            if (ret < 0) {
 +                av_log(s, AV_LOG_ERROR, "Failed to open dynamic buffer\n");
                  return ret;
 +            }
          }
          pb = mkv->dyn_bc;
      }