medialibrary: thumb: check fclose while saving
It should not be assumed that the thumbnail was saved properly when
`fclose` fails.
The RAII wrapper here does not improve readability or shorten the code.
Removing it also works around a GCC `-Wignored-attributes` warning that
was triggered due to `fclose` being tagged as `__nonnull((1))`:
```text
modules/misc/medialibrary/MetadataExtractor.cpp: In member function ‘virtual bool EmbeddedThumbnail::save(const std::string&)’:
modules/misc/medialibrary/MetadataExtractor.cpp:44:44: warning: ignoring attributes on template argument ‘int (*)(FILE*)’ [-Wignored-attributes]
44 | std::unique_ptr<FILE, decltype(&fclose)> f{ vlc_fopen( path.c_str(), "wb" ),
| ^
```
Co-authored-by:
Alexandre Janniaux <ajanni@videolabs.io>
parent
e38b161b
No related branches found
No related tags found
Loading
Please register or sign in to comment