Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hang when invalid file format is specified #236

Closed
waveform80 opened this issue Aug 27, 2015 · 1 comment
Closed

Hang when invalid file format is specified #236

waveform80 opened this issue Aug 27, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@waveform80
Copy link
Owner

When a format which has a valid MIME type but no associated encoder is specified, picamera hangs.

@waveform80 waveform80 added the bug label Aug 28, 2015
@waveform80 waveform80 added this to the 1.11 milestone Aug 28, 2015
@waveform80 waveform80 self-assigned this Aug 28, 2015
@waveform80
Copy link
Owner Author

This occurs because the encoder lock in the camera class is non-re-entrant; the camera class acquires this lock when starting a capture / recording but once the encoder class encounters the unsupported encoding it raises an exception. In doing so, it calls the stop() method which attempts to re-acquire the lock within the same thread and the hang occurs.

This could be fixed by moved the lock acquisition down a line in the stop() method but I'm not sure if this introduces a race condition ... needs more testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant