Revision 7e44761d src/Chunkiser/input-stream-avf.c

View differences:

src/Chunkiser/input-stream-avf.c
97 97
  int32_t pts, dts;
98 98

  
99 99
  if (pkt->pts != AV_NOPTS_VALUE) {
100
    pts = av_rescale_q(pkt->pts, st->time_base, (AVRational){new_tb.den, new_tb.num}),
101
    pts += av_rescale_q(base_ts, AV_TIME_BASE_Q, (AVRational){new_tb.den, new_tb.num});
100
    pts = av_rescale_q(pkt->pts, st->time_base, new_tb),
101
    pts += av_rescale_q(base_ts, AV_TIME_BASE_Q, new_tb);
102 102
  } else {
103 103
    pts = -1;
104 104
  }
105 105
  //dprintf("pkt->pts=%ld PTS=%d",pkt->pts, pts);
106 106
  if (pkt->dts != AV_NOPTS_VALUE) {
107
    dts = av_rescale_q(pkt->dts, st->time_base, (AVRational){new_tb.den, new_tb.num});
108
    dts += av_rescale_q(base_ts, AV_TIME_BASE_Q, (AVRational){new_tb.den, new_tb.num});
107
    dts = av_rescale_q(pkt->dts, st->time_base, new_tb);
108
    dts += av_rescale_q(base_ts, AV_TIME_BASE_Q, new_tb);
109 109
  } else {
110 110
    fprintf(stderr, "No DTS???\n");
111 111
    dts = 0;
......
299 299
  switch (s->s->streams[pkt.stream_index]->codec->codec_type) {
300 300
    case CODEC_TYPE_VIDEO:
301 301
      video_header_fill(data, s->s->streams[pkt.stream_index]);
302
      new_tb = s->s->streams[pkt.stream_index]->avg_frame_rate;
302
      new_tb.den = s->s->streams[pkt.stream_index]->avg_frame_rate.num;
303
      new_tb.num = s->s->streams[pkt.stream_index]->avg_frame_rate.den;
303 304
      if (new_tb.num == 0) {
304
        new_tb = s->s->streams[pkt.stream_index]->r_frame_rate;
305
        new_tb.den = s->s->streams[pkt.stream_index]->r_frame_rate.num;
306
        new_tb.num = s->s->streams[pkt.stream_index]->r_frame_rate.den;
305 307
      }
306 308
      break;
307 309
    case CODEC_TYPE_AUDIO:

Also available in: Unified diff