Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter AdaptationSets with unsupported codecs #3509

Closed
dsilhavy opened this issue Jan 12, 2021 · 1 comment
Closed

Filter AdaptationSets with unsupported codecs #3509

dsilhavy opened this issue Jan 12, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@dsilhavy
Copy link
Collaborator

Environment
  • Link to playable MPD file:
  • Dash.js version: 3.2.0
  • Browser name/version: all
  • OS name/version: all
Steps to reproduce
  1. Try to play an MPD that contains AdaptationSets with an unsupported codec, for instance audio ec-3
Observed behavior

dash.js will not filter the complete AdaptationSet and tries to create a SourceBuffer for an unsupported codec

Console output
[6303][BufferController][audio] Caught error on create SourceBuffer: NotSupportedError: Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('audio/mp4;codecs="ec-3"') is unsupported.
Expected behavior

dash.js should filter unsupported AdaptationSets prior to creating the SourceBuffer. Currently filtering is only done on Representation level

    function filterCodecs(type) {
        const realAdaptation = adapter.getAdaptationForType(streamInfo ? streamInfo.index : null, type, streamInfo);

        if (!realAdaptation || !Array.isArray(realAdaptation.Representation_asArray)) return;

        // Filter codecs that are not supported
        realAdaptation.Representation_asArray = realAdaptation.Representation_asArray.filter((_, i) => {
            // keep at least codec from lowest representation
            if (i === 0) return true;

            const codec = adapter.getCodec(realAdaptation, i, true);
            if (!capabilities.supportsCodec(codec)) {
                logger.error('[Stream] codec not supported: ' + codec);
                return false;
            }
            return true;
        });
    }
@dsilhavy dsilhavy added the Bug label Jan 12, 2021
@dsilhavy dsilhavy self-assigned this Jan 12, 2021
@dsilhavy dsilhavy added this to the 3.2.1 milestone Jan 12, 2021
@dsilhavy
Copy link
Collaborator Author

Fixed in #3512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant