Merge commit '12db891dcd57b305d6e3c1e22ea8204dc26edda1'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Jun 2013 21:58:59 +0000 (23:58 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 16 Jun 2013 21:58:59 +0000 (23:58 +0200)
* commit '12db891dcd57b305d6e3c1e22ea8204dc26edda1':
  avf: move ff_write_chained to mux.c

Conflicts:
libavformat/mux.c
libavformat/utils.c

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

@@@ -828,11 -622,20 +828,33 @@@ fail
      return ret;
  }
  
 +int av_get_output_timestamp(struct AVFormatContext *s, int stream,
 +                            int64_t *dts, int64_t *wall)
 +{
 +    if (!s->oformat || !s->oformat->get_output_timestamp)
 +        return AVERROR(ENOSYS);
 +    s->oformat->get_output_timestamp(s, stream, dts, wall);
 +    return 0;
 +}
++
+ int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
+                      AVFormatContext *src)
+ {
+     AVPacket local_pkt;
+     local_pkt = *pkt;
+     local_pkt.stream_index = dst_stream;
+     if (pkt->pts != AV_NOPTS_VALUE)
+         local_pkt.pts = av_rescale_q(pkt->pts,
+                                      src->streams[pkt->stream_index]->time_base,
+                                      dst->streams[dst_stream]->time_base);
+     if (pkt->dts != AV_NOPTS_VALUE)
+         local_pkt.dts = av_rescale_q(pkt->dts,
+                                      src->streams[pkt->stream_index]->time_base,
+                                      dst->streams[dst_stream]->time_base);
++    if (pkt->duration)
++        local_pkt.duration = av_rescale_q(pkt->duration,
++                                          src->streams[pkt->stream_index]->time_base,
++                                          dst->streams[dst_stream]->time_base);
+     return av_write_frame(dst, &local_pkt);
+ }
Simple merge