Revision 6ff6cff2 libavcodec/h263.c

View differences:

libavcodec/h263.c
2173 2173

  
2174 2174
static void mpeg4_encode_gop_header(MpegEncContext * s){
2175 2175
    int hours, minutes, seconds;
2176
    int64_t time;
2176 2177
    
2177 2178
    put_bits(&s->pb, 16, 0);
2178 2179
    put_bits(&s->pb, 16, GOP_STARTCODE);
2179 2180
    
2180
    seconds= s->time/s->time_increment_resolution;
2181
    if(s->current_picture_ptr->pts){
2182
        time= FFMIN(s->reordered_input_picture[1]->pts, s->current_picture_ptr->pts);
2183
        time= (time*s->time_increment_resolution + 500*1000)/(1000*1000);
2184
    }else
2185
        time= av_rescale(s->current_picture_ptr->coded_picture_number*(int64_t)s->avctx->frame_rate_base, s->time_increment_resolution, s->avctx->frame_rate);
2186

  
2187
    seconds= time/s->time_increment_resolution;
2181 2188
    minutes= seconds/60; seconds %= 60;
2182 2189
    hours= minutes/60; minutes %= 60;
2183 2190
    hours%=24;
......
2190 2197
    put_bits(&s->pb, 1, !!(s->flags&CODEC_FLAG_CLOSED_GOP)); 
2191 2198
    put_bits(&s->pb, 1, 0); //broken link == NO
2192 2199
    
2193
    s->last_time_base= s->time_base;
2200
    s->last_time_base= time / s->time_increment_resolution; 
2194 2201

  
2195 2202
    ff_mpeg4_stuffing(&s->pb);
2196 2203
}

Also available in: Unified diff