• jiajia.qin's avatar
    Report PIPELINE_ERROR_DECODE when SourceState::Append fails. · 5025fd8f
    jiajia.qin authored
    In old implementaion, when SourceState::Append failed, it will report
    DEMUXER_ERROR_COULD_NOT_OPEN error in ChunkDemuxer::AppendData case INITIALIZING.
    But in fact, appended data may include initialization segment and media segment both.
    The error can happen in any point.
    In MSE spec
    ( http://w3c.github.io/media-source/#byte-stream-formats )
    The user agent must run the end of stream algorithm with the error parameter
    set to "decode" when in some conditions. They all happen in parsing the appended data.
    So, here when SourceState::Append fails, it should report PIPELINE_ERROR_DECODE.
    
    Another side, when the segment parser loop successfully parses a complete
    initialization segment, it should call ReportMetadata immediately. Otherwise,
    when meeting PIPELINE_ERROR_DECODE but WebMediaPlayer's ready_state_ is still
    ReadyStateHaveNothing, it will be treated as NetworkStateFormatError not
    NetworkStateDecodeError.
    
    This Cl will resolve above two problems.
    
    BUG=None
    TEST=LayoutTest: https://codereview.chromium.org/742653002
    
    Review URL: https://codereview.chromium.org/710693003
    
    Cr-Commit-Position: refs/heads/master@{#313358}
    5025fd8f
pipeline.cc 22.2 KB