summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* movenc: Require samples before trying to write edtsMartin Storsjö2014-11-08
| | | | | | | This avoids a potential crash if writing a fragmented psp mp4 (which probably is only a hypothetical scenario). Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Avoid leaking locally allocated data when returning on errorsMartin Storsjö2014-11-08
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Remove an outdated commentMartin Storsjö2014-11-08
| | | | | | | QuickTime does support files with an empty initial movie these days. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Write correct presentation timestamps in tfraMartin Storsjö2014-11-07
| | | | | | | Previously we wrote decoding timestamps here, while the specs say it should be presentation timestamps. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Remove a now redundant checkMartin Storsjö2014-11-07
| | | | | | | | | | When using the new first_trun flag instead of checking the track id, we don't need to have a special case for the separate_moof flag any longer. This simplifies the complicated codepath ever so slightly. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Allow to request not to use edit listsMartin Storsjö2014-11-07
| | | | | | | | | | | | | | | | | | | In this case, shift tracks to start from zero instead (potentially stretching the first sample in tracks that start later than the first one). Some software does not support edit lists at all, the adobe flash player seems to be one of these. This results in AV sync errors when edit lists are used to adjust AV sync. Some players, such as QuickTime, don't respect the duration for audio packets, so if an audio track starts later than the video track and the first audio sample gets a duration longer than the actual amount of data in it, the result will be out of sync. Based on patches by Michael Niedermayer. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Print a warning if failed to avoid negative timestamps when requestedMichael Niedermayer2014-11-07
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Add an option for avoiding negative timestampsMichael Niedermayer2014-11-07
| | | | | | | | | | | This is the same logic as is invoked on AVFMT_TS_NEGATIVE, but which can be enabled manually, or can be enabled in muxers which only need it in certain conditions. Also allow using the same mechanism to force streams to start at 0. Signed-off-by: Martin Storsjö <martin@martin.st>
* nutdec: do not set has_b_framesAnton Khirnov2014-11-06
| | | | It is not supposed to be set by demuxers.
* oggenc: accept only STREAMINFO extradataAnton Khirnov2014-11-06
| | | | | The reasoning is the same as for 0097cbea695e534fce39958ccd103af2fbf65831.
* lavf: stop using avpriv_flac_parse_streaminfo()Anton Khirnov2014-11-06
| | | | | | The only parameters needed by the demuxers are the sample rate and sample count, which can be trivially extracted manually, without resorting to an avpriv function.
* riffenc: do not fall back on AVCodecContext.frame_size for MP3Anton Khirnov2014-11-06
| | | | | | | It will not be set unless the codec context is used as the encoding context, which is discouraged. For MP2, av_get_audio_frame_duration() will already set the frame size properly. For MP3, set the frame size explicitly.
* lavf: use the format context strict_std_compliance instead of the codec oneAnton Khirnov2014-11-06
|
* lavc,lavf: switch to the new vorbis parse APIAnton Khirnov2014-11-06
|
* lavc: add a public API for parsing vorbis packets.Anton Khirnov2014-11-06
| | | | | | It is required by (at least) the ogg demuxer. Mark the current semi-public apriv API for removal.
* vorbis_parser: add an AV prefix to VorbisParseContextAnton Khirnov2014-11-06
| | | | This is done in preparation for making it public.
* rtmpproto: Ignore errors from the getStreamLength methodMartin Storsjö2014-11-05
| | | | | | | | | | It is never an error if this method failed. If rt->live was explicitly set to 0 (known to be a recorded file), print it as a warning, otherwise print it as a debug message. Based on a patch by Michael Niedermayer. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Define the flag bits using shifts instead of as decimal numbersMartin Storsjö2014-11-03
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Don't write any iso brands in ismv filesMartin Storsjö2014-10-30
| | | | | | We deviate slightly from the iso specs for these files. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Don't write any tfdt atom for ismv filesMartin Storsjö2014-10-30
| | | | | | | | | The tfdt atom shouldn't be needed in those cases, we already write tfxd atoms for ismv anyway, which is roughly equivalent. This avoids having to declare the iso6 brand for ismv files. Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Write a 0 duration in mdhd and tkhd for an empty initial moovMartin Storsjö2014-10-30
| | | | | | | | | | | | | | ISO/IEC 14496-12:2012/Cor 1:2013 is explicit about how this should be handled. All zeros doesn't mean that the full file has got a zero duration, only that the track samples described within the initial moov have got zero duration. An all ones duration means an indeterminate duration. Keep writing a duration consisting of all ones for the ISM mode - older windows media player versions won't play a file if this is zero. (Newer windows media player versions play either version fine.) Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Add a flag for using default-base-is-moof in tfhd atomsMartin Storsjö2014-10-29
| | | | | | | | | | | | Similarly to the omit_tfhd_offset flag added in e7bf085b, this avoids writing absolute byte positions to the file, making them more easily streamable. This is a new feature from 14496-12:2012, so application support isn't necessarily too widespread yet (support for it in libav was added in 20f95f21f in July 2014). Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Signal iso6 in compatible_brands when using tfdtMartin Storsjö2014-10-29
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Use a local variable consistentlyMartin Storsjö2014-10-29
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Don't check the custom IO flag when using faststartMartin Storsjö2014-10-29
| | | | | | | | The custom IO flag actually never is set for muxers, only for demuxers, so the check was pointless (unless a user intentionally would set the flag to signal using custom IO). Signed-off-by: Martin Storsjö <martin@martin.st>
* movenc: Don't use track_id to decide which track is the first in a moofMartin Storsjö2014-10-29
| | | | | | | | | | If one track doesn't have any samples within a moof, no traf/trun is written for it. When the omit_tfhd_offset flag is set, none of the tfhd atoms have any base_data_offset set, and the implicit offset (end of previous track fragment data, or start of the moof for the first trun) is used. Signed-off-by: Martin Storsjö <martin@martin.st>
* bethsoftvid: simplify return handlingVittorio Giovara2014-10-29
| | | | Fixes a double free in case of av_packet_new_side_data() failure.
* assdec: check av_new_packet return valueVittorio Giovara2014-10-29
| | | | | CC: libav-stable@libav.org Bug-Id: CID 703626
* mtv: improve header check and avoid division by zeroVittorio Giovara2014-10-29
| | | | | CC: libav-stable@libav.org Bug-Id: CID 732203 / CID 732204
* oggenc: remove unneeded null checkMichael Niedermayer2014-10-29
| | | | | | | The code would have segfaulted before if oggstream were NULL. CC: libav-stable@libav.org Bug-Id: CID 732218
* mxfdec: reduce loop bound in mxf_read_pixel_layout()Tomas Härdin2014-10-27
| | | | | | Makes coverity less confused and code more readable. Bug-Id: CID 732262
* bethsoftvid: check return value and clean memoryVittorio Giovara2014-10-27
| | | | | CC: libav-stable@libav.org Bug-Id: CID 733777
* filmstripdec: avoid integer overflowVittorio Giovara2014-10-27
| | | | | CC: libav-stable@libav.org Bug-Id: CID 732246
* matroskaenc: write correct Display{Width, Height} in stereo encodingVittorio Giovara2014-10-27
| | | | | | | | | | | | | should be the raw amount of pixels (for example 3840x1080 for full HD side by side) and the DisplayWidth/Height in pixels should be the amount of pixels for one plane (1920x1080 for that full HD stream)." So, move the aspect ratio check in the mkv_write_stereo_mode() function and always write the embl when stereo format and/or aspect ration is set. Also add a few comments to that function. CC: libav-stable@libav.org Found-by: Asan Usipov <asan.usipov@gmail.com>
* lavf: Implement ff_brktimegm using gmtime_rMartin Storsjö2014-10-26
| | | | | | | While a standalone implementation is nice, we already depend on gmtime and gmtime_r in a number of places. Signed-off-by: Martin Storsjö <martin@martin.st>
* Use gmtime_r instead of gmtime and localtime_r instead of localtimeMartin Storsjö2014-10-26
| | | | | | | | | | | gmtime isn't thread safe in general. In msvcrt (which lacks gmtime_r), the buffer used by gmtime is thread specific though. One call to localtime is left in avconv_opt.c, where thread safety shouldn't matter (instead of making avconv depend on the libavutil internal header). Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: Check the return value of strftimeMartin Storsjö2014-10-26
| | | | | | | | If the buffer provided to strftime is too small, the buffer contents are indeterminate - it does not guarantee actually null terminating the buffer. Signed-off-by: Martin Storsjö <martin@martin.st>
* wtv: Avoid needlessly calling gmtime twice with the same argumentMartin Storsjö2014-10-26
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* mov: fix assigment checkVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1197050
* mxfenc: Fix possible integer overflowsTomas Härdin2014-10-24
| | | | | | | | | None of these are likely unless the user is writing a file with two billion streams or a duration of around two months. CC: libav-stable@libav.org Bug-Id: CID 700568 / CID 700569 / CID 700570 / CID 700571 / CID 700572 / CID 700573
* mxfdec: add missing breakVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 732232
* matroskaenc: check avio_open_dyn_buf return valueVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 703629
* matroskadec: check return valuesVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 733712
* matroskadec: fix leak on errorVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1026767
* lavf: replace rename() with ff_rename()Luca Barbato2014-10-24
| | | | | | | | | The new function wraps errno so that its value is correctly reported when other functions overwrite it (eg. in case of logging). CC: libav-stable@libav.org Bug-Id: CID 1135748 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* flac_picture: prevent a possible out of bound writeVittorio Giovara2014-10-24
| | | | | | | | At "mimetype[len] = 0;" mimetype is a 64 element array and len might be equal to or greater than that. CC: libav-stable@libav.org Bug-Id: CID 1061055
* img2dec: check av_new_packet return valueVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1087077
* audiointerleave: check av_new_packet return valueVittorio Giovara2014-10-24
| | | | | CC: libav-stable@libav.org Bug-Id: CID 1087078
* mp3enc: write full LAME frameAnton Khirnov2014-10-24
| | | | Most importantly, it contains the encoder delay and replaygain info.
* mp3dec: fix reading the Xing tagAnton Khirnov2014-10-24
| | | | | | | The quality scale field is only supposed to be present if the fourth bit is set. In practice, lame always sets it, but other tools might not. CC:libav-stable@libav.org