Put av_register_all() in the right place.
[dcpomatic.git] / src / lib / scoped_temporary.cc
index 3503808bc210c7a09a37caacf0ca839f246ee4cc..4043caf3d28ee91c6224651fa9ca6e1103dc3191 100644 (file)
@@ -21,7 +21,7 @@
 #include "scoped_temporary.h"
 
 /** Construct a ScopedTemporary.  A temporary filename is decided but the file is not opened
- *  until ::open() is called.
+ *  until open() is called.
  */
 ScopedTemporary::ScopedTemporary ()
        : _open (0)
@@ -50,6 +50,7 @@ ScopedTemporary::c_str () const
 FILE*
 ScopedTemporary::open (char const * params)
 {
+       close ();
        _open = fopen (c_str(), params);
        return _open;
 }