Ticket #7397: t7397_mythtv_libav_seek_start_v3.diff
File t7397_mythtv_libav_seek_start_v3.diff, 1.3 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
640 640 return false; 641 641 } 642 642 643 // If seeking to start of stream force a DTS and start_time of zero as644 // libav sometimes returns the end of the stream instead.645 if (desiredFrame <= 1)646 {647 av_update_cur_dts(ic, st, 0);648 ic->start_time = 0;649 }650 651 643 int normalframes = 0; 652 644 653 645 if (st->cur_dts != (int64_t)AV_NOPTS_VALUE) … … 660 652 int64_t st1 = av_rescale(ic->start_time, 661 653 st->time_base.den, 662 654 AV_TIME_BASE * (int64_t)st->time_base.num); 663 adj_cur_dts = lsb3full(adj_cur_dts, st1, st->pts_wrap_bits); 664 655 // If seeking near the start of stream sometimes the adjusted current dts time 656 // is less than the start time (possibly due to the AVSEEK_FLAG_BACKWARD flag ?). 657 // If so, set adjusted current dts to zero. 658 if (adj_cur_dts < st1) 659 adj_cur_dts = 0; 660 else 661 adj_cur_dts = lsb3full(adj_cur_dts, st1, st->pts_wrap_bits); 665 662 } 666 663 667 664 long long newts = av_rescale(adj_cur_dts,