Closed Bug 1094779 Opened 10 years ago Closed 10 years ago

[camera] Unable to record videos if tmp.3gp exists in target video directory

Categories

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

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wilsonpage, Assigned: wilsonpage)

Details

Attachments

(1 file)

46 bytes, text/x-github-pull-request
justindarc
: review+
Details | Review
STEPS

1. Rename one of the video files in the current video directory inside /DCIM (eg. DCIM/MZLA*/tmp.3pg)
2. Attempt to take a video

RESULT

Video recording fails because tmp.3pg can't be overwritten.
Attached file pull-request (master)
FIX

This patch will attempt to delete the .tmp.3pg file if the .addNamed() request fails. If that delete call fails then we give up.
Attachment #8518116 - Flags: review?(jdarcangelo)
Assignee: nobody → wilsonpage
Attachment #8518116 - Flags: review?(jdarcangelo) → review+
Do we want to be blindly deleting video files? Maybe I have one named tmp.3gp.

Wouldn't it be better to add a number? e.g. tmp1.3gp, tmp2.3gp, etc?
(In reply to Mike Habicher [:mikeh] from comment #2)
> Do we want to be blindly deleting video files? Maybe I have one named
> tmp.3gp.
> 
> Wouldn't it be better to add a number? e.g. tmp1.3gp, tmp2.3gp, etc?

This patch changes it to a hidden ".tmp.3gp" which should make it much less likely. It may not be a bad idea to use a number though.
(In reply to Mike Habicher [:mikeh] from comment #2)
> Do we want to be blindly deleting video files? Maybe I have one named
> tmp.3gp.
> 
> Wouldn't it be better to add a number? e.g. tmp1.3gp, tmp2.3gp, etc?

I thought about using a timestamp in the filename but I thought it might be nice to make sure all our tmp.3gp files were cleaned up should for some reason they not be deleted. As Justin commented, I did change to make the file file hidden.
Status: NEW → RESOLVED
Closed: 10 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: