livepeer / go-livepeer

Official Go implementation of the Livepeer protocol
http://livepeer.org
MIT License
547 stars 171 forks source link

broadcaster: Fix video compatibility check #3164

Closed j0sh closed 1 month ago

j0sh commented 1 month ago

What does this pull request do? Explain your changes. (required)

Fixes video compatibility check that led to excessive transcoder re-initialization.

Not all fields will be identical segment-to-segment, particularly DurationSecs. This caused unnecessary transcoder re-initialization.

Specific updates (required)

How did you test each of these updates (required)

  1. Unit tests for the helper
  2. Manual testing to ensure transcoding session gets reused

Does this pull request close any open issues?

Checklist:

j0sh commented 1 month ago

Added a check for the audio codec too, just to be safe - https://github.com/livepeer/go-livepeer/pull/3164/commits/6016b9b1d03edaa419637edb33382f4407238ab9

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 57.36772%. Comparing base (48a92a1) to head (c046e6f). Report is 1 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164/graphs/tree.svg?width=650&height=150&src=pr&token=vKzl2rUYvB&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer)](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) ```diff @@ Coverage Diff @@ ## master #3164 +/- ## =================================================== + Coverage 57.35155% 57.36772% +0.01617% =================================================== Files 92 92 Lines 15813 15819 +6 =================================================== + Hits 9069 9075 +6 Misses 6139 6139 Partials 605 605 ``` | [Files with missing lines](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [server/mediaserver.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?src=pr&el=tree&filepath=server%2Fmediaserver.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-c2VydmVyL21lZGlhc2VydmVyLmdv) | `67.71429% <100.00000%> (+0.18555%)` | :arrow_up: | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Last update [48a92a1...c046e6f](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer). | [Files with missing lines](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer) | Coverage Δ | | |---|---|---| | [server/mediaserver.go](https://app.codecov.io/gh/livepeer/go-livepeer/pull/3164?src=pr&el=tree&filepath=server%2Fmediaserver.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=livepeer#diff-c2VydmVyL21lZGlhc2VydmVyLmdv) | `67.71429% <100.00000%> (+0.18555%)` | :arrow_up: |