Share the utf8 to wchar conversion routine between lavf and lavu

This doesn't add any dependency on library internals, since this
only is a static inline function that gets built into each of the
calling functions - this is only to reduce the code duplication.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavf: Use MoveFileEx instead of rename/_wrename on windows

This allows getting the normal unix semantics, where a rename
allows replacing an existing file.

Based on a suggestion by Reimar Döffinger.

Signed-off-by: Martin Storsjö <martin@martin.st>
Revert "lavf: Don't try to update files atomically with renames on windows"

This reverts commit b9d08c77a44390b0848c06f20bc0e9e951ba6a3c.

After taking MoveFileEx into use, we can replace files with renames
on windows as well.

Signed-off-by: Martin Storsjö <martin@martin.st>
dashenc: Test: Allow skipping writing some segments
movenc: Store the tag name used for free/wide atoms

This simplifies cases where similar placeholders are needed
in other places as well.
movenc: Use start_dts instead of cluster[0].dts for writing edit lists
movenc: Add a placeholder for edts/elst when writing empty_moov in seekable files

Update the placeholder as soon as we know the start timestamp.
movenc: Add an option for delaying writing the moov with empty_moov

This delays writing the moov until the first fragment is written,
or can be flushed by the caller explicitly when wanted. If the first
sample in all streams is available at this point, we can write
proper edts at this point.

This isn't added to the normal behaviour for empty_moov, since
the behaviour that ftyp+moov is written during avformat_write_header
would be changed. Callers that split the output stream into header+segments
(either by flushing manually, with the custom_frag flag set, or by
just differentiating between data written during avformat_write_header
and the rest) will need to be adjusted to take this option into use.

The alternative would be to use different kinds of heuristics for
guessing the start dts (using AVCodecContext delay or has_b_frames
together with the frame rate), but this is not reliable and doesn't
necessarily work well with stream copy.
dashenc: Use delay_moov
movenc: Allow setting the nominal start time of streams

This allows doing random-access writing of fragments,
while writing a correct edit list.
dashenc: Testing: Set the start time properly when skipping segments