| Previous | Next |
| NS_S_CALLABORTED | NS_S_REBUFFERING |
NS_S_STREAM_TRUNCATED
Windows Media stream ended intentionally before completion
NS_S_STREAM_TRUNCATED is HRESULT 851970 (0x000D0002) from Windows Media. The documented description is “The stream was purposefully stopped before completion.” The severity bit indicates a nonfailure result, but the value carries a specific condition that must not be collapsed into plain S_OK.
In the legacy Windows Media pipeline or Player state, this result means that the stream was purposefully stopped before completion. Before reporting completion, the caller must reconcile the code-specific state transition and every usable output.
Where the status is encountered
- Windows Media Player SDK automation; log the exact method and object state instead of interpreting the constant outside that contract.
- Media graph, playlist, image, rights, or buffering state; log the exact method and object state instead of interpreting the constant outside that contract.
What must be true before accepting it
Verify that the shorter stream is expected and downstream components know the final timestamp and completeness state. Without that proof, it can mask a caller error even though HRESULT failure severity is not set.
Reconcile side effects associated with it before compensation or a second invocation is attempted.
Evidence to preserve
- Preserve planned and actual duration.
- Preserve last sample timestamp.
- Preserve stop initiator.
- Preserve container finalization result.
- Preserve complete versus truncated asset flag.
Correct handling and recovery
Finalize the partial stream with correct metadata, mark it truncated, and avoid reporting a complete capture or transcode. Retry only when full output is required.
An unchanged retry after it is useful only when the API explicitly advances through repeated calls.
Difference from nearby results
Correctly separating it from neighboring values selects the proper continuation and cleanup path.
Practical scenario
A live recording is stopped by the user before its planned duration. The writer closes the container cleanly and labels the asset as intentionally truncated.
References
- Microsoft: Windows Media Format SDK error codes — official Microsoft material relevant to this HRESULT.
- Microsoft: Windows Media Player SDK
- Microsoft: Windows Media Player buffering event
- Microsoft: HRESULT values
Looking for a different code? Search another status or error code.
