Commit Graph

14 Commits

Author SHA1 Message Date
Martin Storsjö d872fb0f7f lavf: Reset the entry count and allocation size variables on av_reallocp failures
When av_reallocp fails, the associated variables that keep track of
the number of elements in the array (and in some cases, the
separate number of allocated elements) need to be reset.

Not all of these might technically be needed, but it's better to
reset them if in doubt, to make sure variables don't end up
conflicting.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-26 23:14:03 +03:00
Alexandra Khirnova 5626f994f2 avformat: Use av_reallocp() where suitable
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-09-18 18:28:38 +02:00
Martin Storsjö 310cc4bf82 smoothstreamingenc: Write to a temp file while updating the manifest
If a client tries to read the file while it's being updated, the client
would get an incomplete manifest. Instead write to a separate temp file
and atomically rename it to replace the previous one.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-27 19:44:31 +03:00
Diego Biurrun 511cf612ac miscellaneous typo fixes 2012-12-21 00:18:34 +01:00
Martin Storsjö c44cef978b smoothstreamingenc: Don't assume streams start from timestamp 0
Also use dts instead of pts for deciding where to split fragments.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-24 14:46:08 +03:00
Martin Storsjö cde26748ae smoothstreamingenc: Add a more verbose error message
This helps tracking down the cause if this happens to be an issue.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:35 +03:00
Martin Storsjö fadd3a6821 smoothstreamingenc: Ignore the return value from mkdir
We don't need to return an error if the directory already existed.
We make sure that the directory actually is properly writeable later
within ism_write_header by writing a manifest anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:34 +03:00
Martin Storsjö 8e2763786d smoothstreamingenc: Try writing a manifest when opening the muxer
This allows failing cleaner and earlier if unable to write to
the output directory.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:33 +03:00
Martin Storsjö 3ea06ac59e smoothstreamingenc: Move the output_chunk_list and write_manifest functions up
This allows calling write_manifest from ism_write_header without
a forward declaration.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:32 +03:00
Martin Storsjö 5fa43f76aa smoothstreamingenc: Properly return errors from ism_flush to the caller
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:31 +03:00
Martin Storsjö eb2f391018 smoothstreamingenc: Check the output UrlContext before accessing it
This code can be called with a NULL UrlContext if writing of the
trailer involves seeking.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-10-06 13:05:30 +03:00
Martin Storsjö 71908f0838 smoothstreamingenc: Copy the SAR on the AVStreams as well
This is required in chained muxers, if the SAR happens to be set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-23 21:28:58 +03:00
Martin Storsjö 84cc314e40 smoothstreaming: Export the mp4 codec tags
This fixes stream copy from a format that already has incompatible
codec tags set. The chained ismv muxer exports this same codec tag
list, so set it on this one as well, to allow the caller (and
lavf common code) to set them correctly.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-18 17:59:57 +03:00
Martin Storsjö 62c9ae11a7 Add a smooth streaming segmenter muxer
This muxer splits the output from the ismv muxer into individual
files, in realtime.

The same can also be done by the standalone tool ismindex, but this
muxer is needed for doing it in realtime (especially for live
streams that need extra handling for updating the lookahead fields
in the fragment headers).

Using this muxer, one can deliver live smooth streaming from a
normal static file web server. (Using ismindex, one can deliver
premade smooth streaming files from a static file web server,
or prepare files for serving with IIS.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-09-12 23:42:16 +03:00