Closed
Bug 1168040
Opened 10 years ago
Closed 10 years ago
Stagefright/SampleIterator/MoofParser not properly handling edts' empty edit
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: jya, Assigned: jya)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
6.84 KB,
patch
|
ajones
:
review+
|
Details | Diff | Splinter Review |
15.69 KB,
patch
|
ajones
:
review+
|
Details | Diff | Splinter Review |
1.49 KB,
patch
|
ajones
:
review+
|
Details | Diff | Splinter Review |
In bug 1168004, a new file was added where video starts at 1s and audio at around 2s (actually 1.951s).
This is done via the use of an edit list (EDTS box).
From ISO 14496-12:
Starting offsets for tracks (streams) are represented by an initial empty edit. For example, to play a track from its start for 30 seconds, but at 10 seconds into the presentation, we have the following edit list:
Entry-count = 2
Segment-duration = 10 seconds Media-Time = -1
Media-Rate = 1
Segment-duration = 30 seconds (could be the length of the whole track)
Media-Time = 0 seconds
Media-Rate = 1
Actual:
When demuxing such file, the first frame will have a time of 0.
Expected:
When demuxing such file, the first frame will have a time of 10.
(note that if the file is fragmented, the MoofParser properly handle those)
Assignee | ||
Comment 1•10 years ago
|
||
Have libstagefright properly reads edts with an empty offset
Attachment #8610123 -
Flags: review?(ajones)
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → jyavenard
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•10 years ago
|
||
Properly handle fragmented MP4 and plain MP4 with edts box.
Attachment #8610126 -
Flags: review?(ajones)
Assignee | ||
Comment 3•10 years ago
|
||
actually, moofparser didn't handle those at all. It reads all edts regardless of the track ID and as such, the last edts found was the one used.
The mp4 added in bug 1168004 now plays properly, and so does http://people.mozilla.org/~jyavenard/mediatest/fragmented/bipbop-fragmented.mp4 which is one that always had A/V off by 1s (bug 1138786).
Assignee | ||
Updated•10 years ago
|
Summary: Stagefright/SampleIterator not properly handling edts' empty edit → Stagefright/SampleIterator/MoofParser not properly handling edts' empty edit
Comment 4•10 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #3)
> The mp4 added in bug 1168004 now plays properly, and so does
> http://people.mozilla.org/~jyavenard/mediatest/fragmented/bipbop-fragmented.
> mp4 which is one that always had A/V off by 1s (bug 1138786).
Awesome - thanks jya!
Comment 5•10 years ago
|
||
Comment on attachment 8610126 [details] [diff] [review]
Part2. Properly handle MP4 time offset in MoofParser
Review of attachment 8610126 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/libstagefright/binding/MoofParser.cpp
@@ +415,5 @@
> {
> + if (!aTfhd.IsValid() || !aMvhd.IsValid(), !aMdhd.IsValid() ||
> + !aEdts.IsValid()) {
> + LOG(Moof, "Invalid dependencies: aTfhd(%d) aMvhd(%d) aMdhd(%d) aEdts(%d)",
> + aTfhd.IsValid(), aMvhd.IsValid(), aMdhd.IsValid(), !aEdts.IsValid());
I'm guessing there should be no ! before aEdts.IsValid()
Attachment #8610126 -
Flags: review?(ajones) → review+
Comment 6•10 years ago
|
||
Comment on attachment 8610123 [details] [diff] [review]
Part1. Properly handle MP4 starting offset
Review of attachment 8610123 [details] [diff] [review]:
-----------------------------------------------------------------
Changes to MPEG4Extractor need to land with test cases.
Attachment #8610123 -
Flags: review?(ajones) → review-
Assignee | ||
Comment 7•10 years ago
|
||
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #6)
>
> Changes to MPEG4Extractor need to land with test cases.
Seeing I'm the one who fixed all the security issues in stagefright, I thought that rule could be relaxed a tad, the code is actually safer than it was as it won't attempt to perform a read if there's no data to read.
Plus, testing what? security? that it does what its supposed to do?
Assignee | ||
Comment 8•10 years ago
|
||
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #5)
> Comment on attachment 8610126 [details] [diff] [review]
> Part2. Properly handle MP4 time offset in MoofParser
>
> Review of attachment 8610126 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: media/libstagefright/binding/MoofParser.cpp
> @@ +415,5 @@
> > {
> > + if (!aTfhd.IsValid() || !aMvhd.IsValid(), !aMdhd.IsValid() ||
> > + !aEdts.IsValid()) {
> > + LOG(Moof, "Invalid dependencies: aTfhd(%d) aMvhd(%d) aMdhd(%d) aEdts(%d)",
> > + aTfhd.IsValid(), aMvhd.IsValid(), aMdhd.IsValid(), !aEdts.IsValid());
>
> I'm guessing there should be no ! before aEdts.IsValid()
hmmm no. what's missing is || :)
Comment 9•10 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #8)
> hmmm no. what's missing is || :)
That too. But this but looks wrong:
aTfhd.IsValid(), aMvhd.IsValid(), aMdhd.IsValid(), !aEdts.IsValid());
Notice the !
Comment 10•10 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #7)
> Plus, testing what? security? that it does what its supposed to do?
The test needs to validate the change that you've made. Would it be better to write a test case now, or debug it again later with the new demuxer?
Assignee | ||
Comment 11•10 years ago
|
||
Add +=, -= and * operators to TimeUnit. Started to think that TimeStamp and TimeDuration would have made a better choice for our usage.
Attachment #8612696 -
Flags: review?(matt.woodrow)
Assignee | ||
Updated•10 years ago
|
Attachment #8612696 -
Attachment is obsolete: true
Attachment #8612696 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 12•10 years ago
|
||
dts must use the same timeline as pts. Makes it impossible otherwise to mix samples from different streams. as required by bug 1171330
Attachment #8615803 -
Flags: review?(ajones)
Updated•10 years ago
|
Attachment #8615803 -
Flags: review?(ajones) → review+
Comment 13•10 years ago
|
||
Comment on attachment 8610123 [details] [diff] [review]
Part1. Properly handle MP4 starting offset
Review of attachment 8610123 [details] [diff] [review]:
-----------------------------------------------------------------
Add a test in a follow up bug instead.
Attachment #8610123 -
Flags: review- → review+
Comment 14•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/afa316f85f4c
https://hg.mozilla.org/mozilla-central/rev/320a5acecc4e
https://hg.mozilla.org/mozilla-central/rev/888979f3f342
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Blocks: 1173650
You need to log in
before you can comment on or make changes to this bug.
Description
•