Closed Bug 923297 Opened 11 years ago Closed 11 years ago

[B2G][Video] Video duration can appear off by a second when played in Video app

Categories

(Firefox OS Graveyard :: Gaia::Video, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(b2g18 unaffected, b2g-v1.2 affected)

RESOLVED FIXED
Tracking Status
b2g18 --- unaffected
b2g-v1.2 --- affected

People

(Reporter: mvaughan, Assigned: johnhu)

Details

(Keywords: regression, Whiteboard: burirun2 MEDIA_TRIAGED, Burirun3)

Attachments

(2 files)

Description:
The video duration/length can be shown as one second shorter when being played in the Video app compared to if the video duration is observed on the thumbnail screen within the Video app or on the Gallery app's video player UI. This seems to be because the video recording is stopped less than half a second before the number on the video counter changes to the next number. This fails test case 4458 in the BuriRun 2 run.

Repro Steps:
1) Updated Buri to Build ID: 20131002004001
2) Open the Camera app
3) Select the camcorder icon and begin recording a video
4) Stop recording when you are over half a second of the current number; just before the counter turns to the next number. (ex. counter turns to 0:08... stop recording at 8.6 seconds)
5) Back out to Homescreen
6) Launch the Video app
7) Observe newly recorded video duration on thumbnail screen
8) Play the newly created video 

Actual:
Duration of video appears one second shorter than on thumbnail screen.

Expected:
Duration of video appears the same compared to when viewed thumbnail screen and the Gallery app.

Environmental Variables
Device: Buri
Build ID: 20131002004001
Gecko: http://hg.mozilla.org/releases/mozilla-aurora/rev/b955a00f4167
Gaia: def8e152db6a317162c03a316f68c409f3af3979
Platform Version: 26.0a2
RIL Version: 01.02.00.019.062 

Notes:
Repro frequency: 100%
Test Suite Name: B2G Video
UCID: (videoplay-004)
Link to failed test case: https://moztrap.mozilla.org/manage/cases/?filter-id=4458#caseversion-id-48360
See attached: OneSecondDifference.mp4
Does this reproduce on 1.1?
Keywords: qawanted
This issue does not appear to reproduce on 1.1. If the user stops the video just before the counter turns to the next number, the duration appears as the rounded up time in all areas.

Environmental Variables
Device: Leo
Build ID: 20131001041206
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/c630289d6388
Gaia: 02b975e6ce12922928c74276ac7d19432a03f126
Platform Version: 18.1
blocking-b2g: --- → koi?
Keywords: regression
This bug does not reproduce on the latest Buri 1.1, but does reproduce on the first Buri 1.2 build.

- Works -
Environmental Variables
Build ID: 20131002041201
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/c630289d6388
Gaia: 00757c6b53ef795b6f41b38c9e3408b0126c890f
Platform Version: 18.1

- Broken -
Environmental Variables
Build ID: 20130621031231
Gecko: http://hg.mozilla.org/mozilla-central/rev/7ba8c86f1a56
Gaia: e2f19420fa6a26c4287588701efaec09a750dba1
Platform Version: 24.0a1
blocking-b2g: koi? → ---
Whiteboard: burirun2 → burirun2 MEDIA_TRIAGED
Assignee: nobody → johu
This bug is caused by the inconsistency calculation on metadata and displaying.

Since the MediaUtil.formatDuration calls Math.floor on second, we don't need to call Math.round before that and this patch changes the code to pass the original duration to formatDuration.
Attachment #819534 - Flags: review?(dflanagan)
Whiteboard: burirun2 MEDIA_TRIAGED → burirun2 MEDIA_TRIAGED, Burirun3
Comment on attachment 819534 [details]
remove useless math.round

You're using an undefined variable. The code looks like it can't possibly work.
Attachment #819534 - Flags: review?(dflanagan) → review-
Comment on attachment 819534 [details]
remove useless math.round

I am sorry about the previous version.

The patch had updated to use "_this.data.metadata.duration" instead of d. Please review it again.
Attachment #819534 - Flags: review- → review?(dflanagan)
Attachment #819534 - Flags: review?(dflanagan) → review+
merged to master:
https://github.com/mozilla-b2g/gaia/commit/e60d288b45fee64da9934e3b4e6e085b04285b48
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: