Revision 87c82f76 Chunkiser/input-stream-avs.c

View differences:

Chunkiser/input-stream-avs.c
88 88
  data[8] = den & 0xFF;
89 89
}
90 90

  
91
static void frame_header_fill(uint8_t *data, int size, AVPacket *pkt, AVStream *st)
91
static void frame_header_fill(uint8_t *data, int size, AVPacket *pkt, AVStream *st, int64_t base_ts)
92 92
{
93 93
  AVRational fps;
94 94
  int32_t pts, dts;
......
100 100
    fps = st->r_frame_rate;
101 101
  }
102 102
  pts = av_rescale_q(pkt->pts, st->time_base, (AVRational){fps.den, fps.num}),
103
  pts += av_rescale_q(base_ts, AV_TIME_BASE_Q, (AVRational){fps.den, fps.num});
103 104
  dts = av_rescale_q(pkt->dts, st->time_base, (AVRational){fps.den, fps.num});
105
  dts += av_rescale_q(base_ts, AV_TIME_BASE_Q, (AVRational){fps.den, fps.num});
104 106
  data[2] = pts >> 8;
105 107
  data[3] = pts & 0xFF;
106 108
  data[4] = dts >> 8;
......
295 297
      video_header_fill(data, s->s->streams[pkt.stream_index]);
296 298
    }
297 299
    data[9] = 1;
298
    frame_header_fill(data + 10, *size - header_size - 2 - 2 - 2, &pkt, s->s->streams[pkt.stream_index]);
300
    frame_header_fill(data + 10, *size - header_size - 2 - 2 - 2, &pkt, s->s->streams[pkt.stream_index], s->base_ts);
299 301

  
300 302
    if (header_out && s->s->streams[pkt.stream_index]->codec->extradata_size) {
301 303
      memcpy(data + header_size + 2 + 2 + 2, s->s->streams[pkt.stream_index]->codec->extradata, s->s->streams[pkt.stream_index]->codec->extradata_size);

Also available in: Unified diff