]> git.sesse.net Git - ffmpeg/commitdiff
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

index 9b4b0b1249784d5314e09ddb2f6c24c29ebea814,96193dd9a6acac2a441bb706aa2862b6c88900b7..34c9328c33fcaab630bada57485fc16e94a0e8c1
@@@ -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