Warnings at nsOggReader:946 while seeking

RESOLVED FIXED in mozilla5

Status

()

defect
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: cpearce, Assigned: cpearce)

Tracking

Trunk
mozilla5
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

I sometimes the NS_ENSURE_SUCCESS at http://mxr.mozilla.org/mozilla-central/source/content/media/ogg/nsOggReader.cpp#946 is failing and producing a warning while seeking. e.g.:

0[6de7a8]: WARNING: NS_ENSURE_SUCCESS(res, res) failed with result 0x80004005: file c:/Users/cpearce
/src/blue/objdir/content/media/ogg/../../../../content/media/ogg/nsOggReader.cpp, line 956
WARNING: NS_ENSURE_SUCCESS(res, res) failed with result 0x80004005: file c:/Users/cpearce/src/blue/o
bjdir/content/media/ogg/../../../../content/media/ogg/nsOggReader.cpp, line 956
0[6de7a8]: WARNING: NS_ENSURE_SUCCESS(res, res) failed with result 0x80004005: file c:/Users/cpearce
/src/blue/objdir/content/media/ogg/../../../../content/media/ogg/nsOggReader.cpp, line 956
WARNING: NS_ENSURE_SUCCESS(res, res) failed with result 0x80004005: file c:/Users/cpearce/src/blue/o
bjdir/content/media/ogg/../../../../content/media/ogg/nsOggReader.cpp, line 956

(Note my output has line 956 because I have patches from bug 580531 applied.)

This is caused by our call to nsMediaStream::ReadFromCache() (the result of which we're checking here) trying to read before the start of cached data. This is because nsOggReader::FindEndTime(PRInt64,PRBool,ogg_sync_state*) steps backwards in 5KB chunks from the end of cached data trying to read an ogg page with a timestamp. If it backsteps far enough it ends up trying to read before the start of cached data, that read fails, and we get this warning.

We should cap the read in FindEndTime() to not try to read before the start of cached data, and exit gracefully when FindEndTime() back-steps to the start of cached data without finding an end time.

We also shouldn't be returning an nsresult error code from FindEndTime() on failure; it returns a PRInt64, and callers expect it to return -1 on failure.

Patch to follow.
* Add aStartOffset parameter to nsOggReader::FindEndTime() so that we can be sure not to read before the start of cached data.
* Return -1 instead of an nsresult upon failure in FindEndTime().
* Based on top of the patches from Bug 580531.
Attachment #516731 - Flags: review?(chris.double)

Updated

8 years ago
Attachment #516731 - Flags: review?(chris.double) → review+
Assignee

Updated

8 years ago
Whiteboard: [needs landing post ff4]
Assignee

Updated

8 years ago
Depends on: post2.0
http://hg.mozilla.org/mozilla-central/rev/47ca9ea23fc3
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing post ff4]
Target Milestone: --- → mozilla2.2
Can someone confirm if this is fixed?
You need to log in before you can comment on or make changes to this bug.