[FFmpeg-trac] #2338(avformat:new): avformat_seek_file seeking to wrong frame for AVCHD sample

FFmpeg trac at avcodec.org
Wed Mar 13 11:59:53 CET 2013


#2338: avformat_seek_file seeking to wrong frame for AVCHD sample
-------------------------------------+------------------------------------
             Reporter:  rmk          |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:  avformat
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+------------------------------------

Comment (by rmk):

 The place in the code, where the packet PTS is "corrected" to the strange
 value 63916, is the following in compute_pkt_fields

     if (pc && pc->dts_sync_point >= 0) {
         // we have synchronization info from the parser
         int64_t den = st->codec->time_base.den * (int64_t)
 st->time_base.num;
         if (den > 0) {
             int64_t num = st->codec->time_base.num * (int64_t)
 st->time_base.den;
             if (pkt->dts != AV_NOPTS_VALUE) {
                 // got DTS from the stream, update reference timestamp
                 st->reference_dts = pkt->dts - pc->dts_ref_dts_delta * num
 / den;
                 pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
 > here the correct pts 67515 is replaced by DTS (63915) + 1, i.e.  63916
             } else if (st->reference_dts != AV_NOPTS_VALUE) {
                 // compute DTS based on reference timestamp
                 pkt->dts = st->reference_dts + pc->dts_ref_dts_delta * num
 / den;
                 pkt->pts = pkt->dts + pc->pts_dts_delta * num / den;
             }
             if (pc->dts_sync_point > 0)
                 st->reference_dts = pkt->dts; // new reference
         }
     }

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2338#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list