If the first Sample references the first stsd entry, then setting it here is redundant.
Unified · Split
| @@ -10684,9 +10684,9 @@ static int mov_read_header(AVFormatContext *s) · 10683 unmodified lines | |||
| 10684 | uint32_t dvdsub_clut[FF_DVDCLUT_CLUT_LEN] = {0}; | 10684 | uint32_t dvdsub_clut[FF_DVDCLUT_CLUT_LEN] = {0}; |
| 10685 | fix_timescale(mov, sc); | 10685 | fix_timescale(mov, sc); |
| 10686 | 10686 | ||
| 10687 | /* Set the primary extradata based on the first Sample. */ | 10687 | /* Set the primary extradata based on the first Sample if it doesn't reference the first stsd entry. */ |
| 10688 | if (sc->stsc_count && sc->extradata_size && !sc->iamf && | 10688 | if (sc->stsc_count && sc->extradata_size && !sc->iamf && |
| 10689 | sc->stsc_data[0].id > 0 && sc->stsc_data[0].id <= sc->stsd_count) { | 10689 | sc->stsc_data[0].id > 1 && sc->stsc_data[0].id <= sc->stsd_count) { |
| 10690 | sc->last_stsd_index = sc->stsc_data[0].id - 1; | 10690 | sc->last_stsd_index = sc->stsc_data[0].id - 1; |
| 10691 | av_freep(&st->codecpar->extradata); | 10691 | av_freep(&st->codecpar->extradata); |
| 10692 | st->codecpar->extradata_size = sc->extradata_size[sc->last_stsd_index]; | 10692 | st->codecpar->extradata_size = sc->extradata_size[sc->last_stsd_index]; |