| 2616 | } |
| 2617 | |
| 2618 | static hb_buffer_t * setSubDuration(sync_stream_t * stream, hb_buffer_t * sub) |
| 2619 | { |
| 2620 | if (sub->s.flags & HB_BUF_FLAG_EOS) |
| 2621 | { |
| 2622 | return sub; |
| 2623 | } |
| 2624 | if (sub->s.stop != AV_NOPTS_VALUE) |
| 2625 | { |
| 2626 | sub->s.duration = sub->s.stop - sub->s.start; |
| 2627 | if (sub->s.duration <= 0) |
| 2628 | { |
| 2629 | hb_log("sync: subtitle 0x%x duration <= 0, PTS %"PRId64"", |
| 2630 | stream->subtitle.subtitle->id, sub->s.start); |
| 2631 | hb_buffer_close(&sub); |
| 2632 | } |
| 2633 | } |
| 2634 | else if (stream->subtitle.sanitizer.link) |
| 2635 | { |
| 2636 | hb_log("sync: subtitle 0x%x duration not set, PTS %"PRId64"", |
| 2637 | stream->subtitle.subtitle->id, sub->s.start); |
| 2638 | sub->s.duration = (int64_t)AV_NOPTS_VALUE; |
| 2639 | } |
| 2640 | return sub; |
| 2641 | } |
| 2642 | |
| 2643 | // Create a list of buffers that overlap the given start time. |
| 2644 | // Returns a list of buffers and the smallest stop time of those |
no test coverage detected