Commit Graph

254 Commits

Author SHA1 Message Date
Matthieu Bouron
5d75e46677 Merge commit 'db7968bff4851c2be79b15b2cb2ae747424d2fca'
* commit 'db7968bff4851c2be79b15b2cb2ae747424d2fca':
  avio: Allow custom IO users to get labels for the output bytestream

Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-23 15:59:44 +02:00
Clément Bœsch
a444a50510 Merge commit '11de006babf735aafa3462d43dd2c02bb6ac6e2f'
* commit '11de006babf735aafa3462d43dd2c02bb6ac6e2f':
  Combine deprecation guards where appropriate

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-22 17:36:42 +02:00
Marton Balint
e07b8d68f5 avformat/mux: do not call write_packet with a flush packet if header is not written
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-06-20 00:27:26 +02:00
Marton Balint
517fe64406 avformat/mux: do not call write_header multiple times if it fails the first time
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-06-20 00:27:26 +02:00
Marton Balint
9da27fb579 avformat/mux: factorize header writing code
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-06-13 22:43:22 +02:00
Marton Balint
301ead1313 avformat/mux: call deinit if write_header fails
Docs clearly states that av_write_trailer should only be called if
avformat_write_header was successful, therefore we have to deinit if we return
failure.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-06-13 22:43:22 +02:00
Martin Storsjö
e1eb0fc960 movenc: Use packets in interleaving queues for the duration at the end of fragments
As long as caller only writes packets using av_interleaved_write_frame
with no manual flushing, this should allow us to always have accurate
durations at the end of fragments, since there should be at least
one queued packet in each stream (except for the stream where the
current packet is being written, but if the muxer itself does the
cutting of fragments, it also has info about the next packet for that
stream).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:37:03 +03:00
Martin Storsjö
db7968bff4 avio: Allow custom IO users to get labels for the output bytestream
This allows callers with avio write callbacks to get the bytestream
positions that correspond to keyframes, suitable for live streaming.

In the simplest form, a caller could expect that a header is written
to the bytestream during the avformat_write_header, and the data
output to the avio context during e.g. av_write_frame corresponds
exactly to the current packet passed in.

When combined with av_interleaved_write_frame, and with muxers that
do buffering (most muxers that do some sort of fragmenting or
clustering), the mapping from input data to bytestream positions
is nontrivial.

This allows callers to get directly information about what part
of the bytestream is what, without having to resort to assumptions
about the muxer behaviour.

One keyframe/fragment/block can still be split into multiple (if
they are larger than the aviocontext buffer), which would call
the callback with e.g. AVIO_DATA_MARKER_SYNC_POINT, followed by
AVIO_DATA_MARKER_UNKNOWN for the second time it is called with
the following data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:36:45 +03:00
Diego Biurrun
11de006bab Combine deprecation guards where appropriate
Some code blocks use multiple bits of deprecated API.
2016-05-13 15:14:30 +02:00
Diego Biurrun
b7e64fba7f Reduce the scope of some variables
This avoids unused variable warnings after the next version bump.
Also drop a trace level av_log() call that is in the way.
2016-05-11 12:21:25 +02:00
Diego Biurrun
0f40c90984 Drop pointless assert.h #includes 2016-05-03 15:45:10 +02:00
Michael Niedermayer
c84ba07db4 avformat/mux: Check that deinit is set before calling it
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-24 12:07:37 +02:00
Derek Buitenhuis
af9cac1be1 Merge commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab'
* commit '33d18982fa03feb061c8f744a4f0a9175c1f63ab':
  lavc: add a new bitstream filtering API

Conversions-by: Hendrik Leppkes <h.leppkes@gmail.com>
Conversions-by: Derek Buitenguis <derek.buitenhuis@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-17 18:47:40 +01:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Ronald S. Bultje
6d8ab358a3 lavf: allow BSFs to drop packets.
If pkt->size == 0 && pkt->side_data_elems == 0 after bsf->filter()
returns, the packet is considered dropped.
2016-03-11 11:19:10 -05:00
Stefano Sabatini
dedcb3c5a5 lavf/mux: do not fail in case of non strictly monotonically increasing DTS values for data packets
Consistent with what we already do with subtitles since ac08c5c0ad.
2016-02-26 10:18:09 +01:00
Anton Khirnov
9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.

In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.

There are multiple important problems with this approach:
    - the fields in AVCodecContext are in general one of
        * stream parameters
        * codec options
        * codec state
      However, it's not clear which ones are which. It is consequently
      unclear which fields are a demuxer allowed to set or a muxer allowed to
      read. This leads to erratic behaviour depending on whether decoding or
      encoding is being performed or not (and whether it uses the AVStream
      embedded codec context).
    - various synchronization issues arising from the fact that the same
      context is used by several different APIs (muxers/demuxers,
      parsers, bitstream filters and encoders/decoders) simultaneously, with
      there being no clear rules for who can modify what and the different
      processes being typically delayed with respect to each other.
    - avformat_find_stream_info() making it necessary to support opening
      and closing a single codec context multiple times, thus
      complicating the semantics of freeing various allocated objects in the
      codec context.

Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
2016-02-23 17:01:58 +01:00
Derek Buitenhuis
895b888f16 Merge commit '521dc78366c6ea54b7b69426dab302a57231f81e'
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:56:22 +00:00
Matt Oliver
b66ac803fa avformat/mux: Fix error when writing uncoded frames.
commit "avpacket: Deprecate av_dup_packet" broke the use
av_interleaved_write_uncoded_frame as any input uncoded frame has an
invalid packet size that will crash when av_packet_ref tries to allocate
'size' new memory. Since the packet is a temporary created within mux.c
itself it can be used directly without needing a new ref.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2016-01-27 17:16:43 +11:00
Anton Khirnov
521dc78366 mux: drop the warning about global headers
The AVStream codec context is often not (and should not be) the actual
encoding context, so this warning will be spurious in many cases.
2016-01-12 09:12:24 +01:00
Rodger Combs
1f9139b07b lavf: add automatic bitstream filtering; bump version
This solves the problem discussed in https://ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179238.html
by allowing AVCodec::write_header to be delayed until after packets have been
run through required bitstream filters in order to generate global extradata.

It also provides a mechanism by which a muxer can add a bitstream filter to a
stream automatically, rather than prompting the user to do so.
2015-12-28 08:40:35 -06:00
Michael Niedermayer
0106a20aea avformat/mux: Rename compute_pkt_fields2(), the name is absolutely terrible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 23:06:32 +01:00
Hendrik Leppkes
611c22140a Merge commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8'
* commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8':
  lavf: deprecate compute_pkt_fields2

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-11 14:37:48 +01:00
Anton Khirnov
8de1ee9f72 lavf: deprecate compute_pkt_fields2
All encoders set pts and dts properly now (and have been doing that for
a while), so there is no good reason to do any timestamp guessing in the
muxer.

The newly added AVStreamInternal will be later used for storing all the
private fields currently living in AVStream.
2015-11-09 07:50:55 +01:00
Hendrik Leppkes
87a6f532b4 Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'
* commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6':
  avpacket: Deprecate av_dup_packet

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:16:44 +01:00
Hendrik Leppkes
7f5af80ba4 Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
  avpacket: Replace av_free_packet with av_packet_unref

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Luca Barbato
9b56d5c114 avpacket: Deprecate av_dup_packet
As documented, `av_dup_packet` is broken by design, `av_packet_ref`
matches the AVFrame ref-counted API and can be safely used instead.
2015-10-26 18:00:55 +01:00
Luca Barbato
ce70f28a17 avpacket: Replace av_free_packet with av_packet_unref
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.

Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Ganesh Ajjanagadde
8507b98c10 avfilter,swresample,swscale: use fabs, fabsf instead of FFABS
It is well known that fabs and fabsf are at least as fast and sometimes
faster than the FFABS macro, at least on the gcc+glibc combination.
For instance, see the reference:
http://patchwork.sourceware.org/patch/6735/.
This was a patch to glibc in order to remove their usages of a macro.

The reason essentially boils down to fabs using the __builtin_fabs of
the compiler, while FFABS needs to infer to not use a branch and to
simply change the sign bit. Usually the inference works, but sometimes
it does not. This may be easily checked by looking at the asm.

This also has the added benefit of reducing macro usage, which has
problems with side-effects.

Note that avcodec is not handled here, as it is huge and
most things there are integer arithmetic anyway.

Tested with FATE.

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-10-22 16:13:26 -04:00
Hendrik Leppkes
b01891a9f0 Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'
* commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d':
  lavc: Make AVPacket.duration int64, and deprecate convergence_duration

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-29 15:22:52 +02:00
Hendrik Leppkes
1f1c100833 Merge commit '9ad1e0c12caa440de860bd8f2122beb11d73815c'
* commit '9ad1e0c12caa440de860bd8f2122beb11d73815c':
  mux: Make sure that the data is actually written

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-07 16:19:40 +02:00
Hendrik Leppkes
83a5df54ea Remove left-over FF_API_DESTRUCT_PACKET cruft 2015-09-05 16:51:53 +02:00
Hendrik Leppkes
87c8812270 Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'
* commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8':
  lavc: Drop deprecated destruct_packet related functions

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:50:09 +02:00
Sean McGovern
9ad1e0c12c mux: Make sure that the data is actually written
And forward the error if it is not.

Bug-Id: 881

CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-03 13:39:34 +02:00
Andreas Cadhalpun
c34363acd2 mux: warn if the encoders bitexact flag is set, but not the muxers
Based-on-patch-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-30 23:30:09 +02:00
Vittorio Giovara
01bcc2d5c2 lavc: Drop deprecated destruct_packet related functions
Deprecated in 10/2012.
2015-08-28 16:01:16 +02:00
Michael Niedermayer
b4d68e7cdb avformat: Remove use of AVFrac and AVStream->pts
Move field to internal part of AVStream and struct to internal.h

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-23 04:16:02 +02:00
Andreas Cadhalpun
c363843a53 add missing FF_API_DESTRUCT_PACKET guards
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-08-22 19:16:13 +02:00
Michael Niedermayer
db91e0edb6 avformat/mux: Update sidedata in ff_write_chained()
Fixes Ticket4777

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 03:42:04 +02:00
Michael Niedermayer
94d68a41fa Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'
* commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615':
  lavc: AV-prefix all codec flags

Conflicts:
	doc/examples/muxing.c
	ffmpeg.c
	ffmpeg_opt.c
	ffplay.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.c
	libavcodec/ac3enc_float.c
	libavcodec/atrac1.c
	libavcodec/atrac3.c
	libavcodec/atrac3plusdec.c
	libavcodec/dcadec.c
	libavcodec/ffv1enc.c
	libavcodec/h264.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_mb.c
	libavcodec/imc.c
	libavcodec/libmp3lame.c
	libavcodec/libtheoraenc.c
	libavcodec/libtwolame.c
	libavcodec/libvpxenc.c
	libavcodec/libxavs.c
	libavcodec/libxvid.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg12enc.c
	libavcodec/mpegaudiodec_template.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_motion.c
	libavcodec/nellymoserdec.c
	libavcodec/nellymoserenc.c
	libavcodec/nvenc.c
	libavcodec/on2avc.c
	libavcodec/options_table.h
	libavcodec/opus_celt.c
	libavcodec/pngenc.c
	libavcodec/ra288.c
	libavcodec/ratecontrol.c
	libavcodec/twinvq.c
	libavcodec/vc1_block.c
	libavcodec/vc1_loopfilter.c
	libavcodec/vc1_mc.c
	libavcodec/vc1dec.c
	libavcodec/vorbisdec.c
	libavcodec/vp3.c
	libavcodec/wma.c
	libavcodec/wmaprodec.c
	libavcodec/x86/hpeldsp_init.c
	libavcodec/x86/me_cmp_init.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:10:35 +02:00
Vittorio Giovara
7c6eb0a1b7 lavc: AV-prefix all codec flags
Convert doxygen to multiline and express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Michael Niedermayer
a45cf639e6 libavformat/mux: Add ff_choose_chroma_location()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-22 15:30:31 +02:00
Michael Niedermayer
da4ef13cb2 avformat/mux: use <0 instead of != 0 for error check of init_muxer()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-16 18:37:21 +02:00
Michael Niedermayer
e0010bb91f mux: Do not leave stale side data pointers in ff_interleave_add_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-05-06 15:01:35 +01:00
Michael Niedermayer
7ac5c38ec5 avformat/mux: Add avoid_negative_ts_use_pts
This allows using pts instead of dts for negative TS avoidance

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-05 12:44:20 +02:00
Michael Niedermayer
d4cf377947 avformat/mux: Place timestamp related trace av_logs under FF_FDEBUG_TS
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 17:36:36 +02:00
Michael Niedermayer
40d552dae6 Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'
* commit '1a3eb042c704dea190c644def5b32c9cee8832b8':
  Replace av_dlog with normal av_log at trace level

Conflicts:
	ffplay.c
	libavdevice/fbdev_dec.c
	libavfilter/avfilter.c
	libavfilter/internal.h
	libavfilter/setpts.c
	libavfilter/src_movie.c
	libavfilter/vf_crop.c
	libavfilter/vf_drawtext.c
	libavfilter/vf_fieldorder.c
	libavformat/assdec.c
	libavformat/avidec.c
	libavformat/flvdec.c
	libavformat/http.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/mov.c
	libavformat/mpegenc.c
	libavformat/mpegts.c
	libavformat/mpegtsenc.c
	libavformat/mux.c
	libavformat/mxfdec.c
	libavformat/nsvdec.c
	libavformat/oggdec.c
	libavformat/r3d.c
	libavformat/rtspdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 03:19:47 +02:00
Vittorio Giovara
1a3eb042c7 Replace av_dlog with normal av_log at trace level
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Michael Niedermayer
2924514721 Merge commit '9deaec782810d098bca11c9332fab2d2f4c5fb78'
* commit '9deaec782810d098bca11c9332fab2d2f4c5fb78':
  lavf: move internal fields from public to internal context

Conflicts:
	libavformat/avformat.h
	libavformat/internal.h
	libavformat/mux.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-11 02:47:54 +01:00
wm4
9deaec7828 lavf: move internal fields from public to internal context
This is not an API change; the fields were explicitly declared private
before.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-02-10 21:45:04 +01:00
Paul B Mahol
41456c7d15 avformat/mux: remove unneeded #include, there are no assert() only av_assert*
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-01-31 08:57:07 +00:00
Michael Niedermayer
ac08c5c0ad avformat/mux: 2 subtitle packets could have the same DTS
Fixes Ticket3514

See: ETSI EN 300 743 V1.3.1 (2006-11)
"In summary, all of the segments of a single display set shall be carried in one (or more) PES packets that have the same
 PTS value."
with PTS = DTS and remuxing of such a stream it is to be expected that sometimes
multiple packets would have the same DTS

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-29 03:57:44 +01:00
Martin Storsjö
4895aa65c6 libavformat: Allow calling av_write_trailer with a NULL AVIOContext
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-12-19 23:12:58 +02:00
Carl Eugen Hoyos
25ccf5df72 lavf/mux: Always call write_trailer() from av_write_trailer() to avoid a leak.
Fixes ticket #4049.
2014-11-20 10:14:51 +01:00
Michael Niedermayer
9943c5a42b Merge commit '9257692ac15eff7b07540c1f61cebde0d8823fbd'
* commit '9257692ac15eff7b07540c1f61cebde0d8823fbd':
  lavf: Only initialize s->offset once when using avoid_negative_ts make_zero

Conflicts:
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-18 02:46:07 +01:00
Martin Storsjö
9257692ac1 lavf: Only initialize s->offset once when using avoid_negative_ts make_zero
When given a stream starting at dts=0, it would previously consider
s->offset as uninitialized and set an offset when the second packet
was written, ending up writing two packets with dts=0. By initializing
this field to AV_NOPTS_VALUE, we make sure that we only initialize it
once, on the first packet.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-17 23:18:55 +02:00
Michael Niedermayer
0d71e825db Merge commit '897d5c3a4296f3da80b8699d1487328ca2de8e55'
* commit '897d5c3a4296f3da80b8699d1487328ca2de8e55':
  lavf: Print a warning if failed to avoid negative timestamps when requested

Conflicts:
	libavformat/mux.c

See: ec6a5fc6cc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-07 23:22:10 +01:00
Michael Niedermayer
66e49ff3b9 Merge commit '1384df641994bf3d6cb51084290aa94752737bae'
* commit '1384df641994bf3d6cb51084290aa94752737bae':
  lavf: Add an option for avoiding negative timestamps

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/options_table.h
	libavformat/version.h

See: 3ba0dab76a
See: a89c012531
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-07 23:09:30 +01:00
Michael Niedermayer
897d5c3a42 lavf: Print a warning if failed to avoid negative timestamps when requested
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 12:11:46 +02:00
Michael Niedermayer
1384df6419 lavf: Add an option for avoiding negative timestamps
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>
2014-11-07 12:11:35 +02:00
Michael Niedermayer
042eba52a5 Merge commit '91e8d2eb1f7bf3af949008b106ec1ca037b88b0e'
* commit '91e8d2eb1f7bf3af949008b106ec1ca037b88b0e':
  lavf: use the format context strict_std_compliance instead of the codec one

Conflicts:
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-06 13:10:01 +01:00
Anton Khirnov
91e8d2eb1f lavf: use the format context strict_std_compliance instead of the codec one 2014-11-06 09:01:49 +01:00
Michael Niedermayer
ec6a5fc6cc avformat/mux: Fix assertion failure due to max_interleave_delta and poor input
Fixes Ticket4051

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-22 16:28:49 +02:00
Michael Niedermayer
2b37864e7f Merge commit '2d6e58497e76836604364b037df9b00ba3d75b69'
* commit '2d6e58497e76836604364b037df9b00ba3d75b69':
  lavf: switch to AVCodecContext.framerate for demuxing

Conflicts:
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 18:19:58 +02:00
Anton Khirnov
2d6e58497e lavf: switch to AVCodecContext.framerate for demuxing 2014-10-15 06:37:55 +00:00
Michael Niedermayer
fc6aa30459 Merge commit 'eb4f9069002e73648f6640cd054fc814cfda75b8'
* commit 'eb4f9069002e73648f6640cd054fc814cfda75b8':
  lavf: More informative error message

Conflicts:
	libavformat/mux.c

See: 30ced7e69f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-10 20:38:51 +02:00
Luca Barbato
eb4f906900 lavf: More informative error message
Print the timestamp values and not just the stream index.
2014-10-10 16:29:06 +02:00
James Almer
903a0acba4 avformat: remove obsolete FF_API_ALLOC_OUTPUT_CONTEXT cruft
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:07 -03:00
Anton Khirnov
d92550d191 lavf: eliminate ff_get_audio_frame_size()
It is basically a wrapper around av_get_audio_frame_duration(), with a
fallback to AVCodecContext.frame_size. However, that field is set only
when the stream codec context is actually used for encoding or decoding,
which is discouraged.

For muxing, it is generally the responsibility of the caller to set the
packet duration.
For demuxing, if the duration is not stored at the container level, it
should be set by the parser.

Therefore, removing the frame_size fallback should not break any
important case.
(cherry picked from commit 30e50c5027)

Conflicts:

	libavformat/utils.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 03:12:58 +02:00
Michael Niedermayer
fee982048e avformat/mux: flush after header writing, like after packets
This makes problematic unconditional flushes in mpegts redundant
And is thus part of a fix for ticket 2748

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-03 18:10:04 +02:00
Carl Eugen Hoyos
355121bcb5 lavf/mux: Fix a typo checking aspect ratios.
Fixes ticket #3813.
2014-07-30 11:03:29 +02:00
Michael Niedermayer
a06fac353c avformat/mux: ignore delayed vp8/9 packets in max_interleave_delta calculation
libvpx adds very significant delay, which appears normal and we must
buffer all other streams no matter what to interleave them correctly

Fixes Ticket3440

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-26 01:11:00 +02:00
Michael Niedermayer
351b22caae avformat/mux: support re-interleaving packets in ff_write_chained()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 22:39:22 +02:00
Michael Niedermayer
383a04a127 avformat/mux: keep AVPacket fields consistent in ff_write_chained()
This might have caused double frees in theory, i do not have a test case
though

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 22:33:21 +02:00
Michael Niedermayer
e5cb7795fc Merge commit '324ff59444ff5470bb325ff1e2be7c4b054fc944'
* commit '324ff59444ff5470bb325ff1e2be7c4b054fc944':
  avpacket: Check for and return errors in ff_interleave_add_packet()

Conflicts:
	libavformat/audiointerleave.c
	libavformat/internal.h
	libavformat/mux.c

See: 4d7c71c364
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-17 14:20:10 +02:00
Nidhi Makhijani
324ff59444 avpacket: Check for and return errors in ff_interleave_add_packet()
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-07-17 03:18:46 -07:00
Michael Niedermayer
c599c211fb avformat/mux: fix flush_packets flag with flushing buffers
Found-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-28 21:23:32 +02:00
Michael Niedermayer
1d54f51084 avformat/mux: simplify ff_choose_timebase()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 20:09:55 +02:00
Michael Niedermayer
ac293b6685 Merge commit '194be1f43ea391eb986732707435176e579265aa'
* commit '194be1f43ea391eb986732707435176e579265aa':
  lavf: switch to AVStream.time_base as the hint for the muxer timebase

Conflicts:
	doc/APIchanges
	libavformat/filmstripenc.c
	libavformat/movenc.c
	libavformat/mxfenc.c
	libavformat/oggenc.c
	libavformat/swf.h
	libavformat/version.h
	tests/ref/lavf/mkv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 19:49:17 +02:00
Anton Khirnov
194be1f43e lavf: switch to AVStream.time_base as the hint for the muxer timebase
Previously, AVStream.codec.time_base was used for that purpose, which
was quite confusing for the callers. This change also opens the path for
removing AVStream.codec.

The change in the lavf-mkv test is due to the native timebase (1/1000)
being used instead of the default one (1/90000), so the packets are now
sent to the crc muxer in the same order in which they are demuxed
(previously some of them got reordered because of inexact timestamp
conversion).
2014-06-18 15:12:34 +02:00
Michael Niedermayer
bfb3ed1a9d avformat/mux: Dont leave stale side data pointers in ff_interleave_add_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 14:48:22 +02:00
Michael Niedermayer
74ece44373 avformat/mux: fix memleak of side data in flac fate tests
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 14:38:03 +02:00
Michael Niedermayer
9893e883ea avformat/mux: Remove localized encoder strings
Fixes muxing to end up with a encoder=Lavf... and encoder_eng=somethingelse

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-20 02:46:42 +02:00
Michael Niedermayer
999a99c865 Merge commit 'a312f71090ee620ee252f2034aef6b13e2dafe9c'
* commit 'a312f71090ee620ee252f2034aef6b13e2dafe9c':
  lavf: deprecate now unused AVStream.pts

Conflicts:
	libavformat/mux.c
	libavformat/version.h

mostly not merged as the code is needed for a/vsync drop handling
and what the code does is what is needed, it could maybe be moved
elsewhere or factored somehow but simply removing it would be droping
these features.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 18:38:10 +02:00
Anton Khirnov
a312f71090 lavf: deprecate now unused AVStream.pts 2014-05-19 07:14:24 +02:00
Anton Khirnov
ed7922faac mux: drop one of the hacks comprising compute_pkt_fields2()
All encoders should output proper timestamps now.
2014-05-19 07:14:18 +02:00
Michael Niedermayer
f478e8500a Merge commit 'c9281a01b78cc3f09e36300a0ca3f5824d1c74cf'
* commit 'c9281a01b78cc3f09e36300a0ca3f5824d1c74cf':
  lavf: drop the zero-sized packets hack

Conflicts:
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-15 19:24:19 +02:00
Michael Niedermayer
eacf7d650d Merge commit '0c1959b056f6ccaa2eee2c824352ba93c8e36d52'
* commit '0c1959b056f6ccaa2eee2c824352ba93c8e36d52':
  lavf: add AVFMT_FLAG_BITEXACT.

Conflicts:
	doc/APIchanges
	libavformat/avformat.h
	libavformat/flacenc.c
	libavformat/movenc.c
	libavformat/oggenc.c
	libavformat/options_table.h
	libavformat/version.h
	tests/fate/video.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-15 19:16:57 +02:00
Anton Khirnov
c9281a01b7 lavf: drop the zero-sized packets hack
There should not be any valid reason anymore for passing completely
empty packets to lavf.
OTOH side data-only packets can be useful.
2014-05-15 07:50:47 +02:00
Anton Khirnov
0c1959b056 lavf: add AVFMT_FLAG_BITEXACT.
Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's
codec context.

Using codec options inside lavf is fragile and can easily break when the
muxing codec context is not the encoding context.
2014-05-15 07:42:07 +02:00
Lukasz Marek
c9a12fdd2d lavf/mux: pass options to nested structs of priv data
This is continuation of commit 330d547e
Nested struct is set in two places.
Previous commit set nested struct only in one case.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-04 14:46:37 +02:00
Lukasz Marek
330d547ef3 lavf/mux: pass options to nested structs of priv data
This commit allows to benefit from implementing child_next
callback for muxers' AVClasses.
Without that, options cannot be set in nested structs.

Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-05-02 18:04:05 +02:00
Michael Niedermayer
dc6a17cf74 avformat/mux: Check for and remove invalid packet durations
Fixes assertion failure
Fixes Ticket3575

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-23 06:55:33 +02:00
Reimar Döffinger
8cbf0827e1 Various small spelling fixes.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-04-22 20:44:31 +02:00
Michael Niedermayer
a89c012531 avformat/mux: support shifting timestamps so they start at 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-22 22:39:49 +01:00
Nicolas George
916a79227e lavf/mux: check av_dup_packet() return value.
Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-20 02:58:39 +01:00
Nicolas George
1b05ac220e lavf: add write_uncoded_frame() API. 2014-02-11 10:29:02 +01:00
Michael Niedermayer
8560fdc451 Merge commit '394fb56c29eee7f4f8f0334d8b5d30d3c54ac703'
* commit '394fb56c29eee7f4f8f0334d8b5d30d3c54ac703':
  lavf: always unref the packet passed to av_interleaved_write_frame() on error

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-10 20:30:58 +01:00
Anton Khirnov
394fb56c29 lavf: always unref the packet passed to av_interleaved_write_frame() on error 2014-02-10 15:08:06 +01:00
Michael Niedermayer
3adb5f8d8b Merge commit 'd9ae1031f5edbd25c8526b4cb51aba66d3bee931'
* commit 'd9ae1031f5edbd25c8526b4cb51aba66d3bee931':
  lavf: improve handling of sparse streams when muxing

Conflicts:
	doc/APIchanges
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/options_table.h
	libavformat/version.h

See: 37ed5df5c5
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-05 03:19:22 +01:00
Luca Barbato
d9ae1031f5 lavf: improve handling of sparse streams when muxing
Currently ff_interleave_packet_per_dts() waits until it gets a frame for
each stream before outputting packets in interleaved order.

Sparse streams (i.e. streams with much fewer packets than the other
streams, like subtitles or audio with DTX) tend to add up latency and in
specific cases end up allocating a large amount of memory.

Emit the top packet from the packet_buffer if it has a time delta
larger than a specified threshold.

Original report of the issue and initial proposed solution by
mus.svz@gmail.com.

Bug-id: 31
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-02-04 22:01:42 +01:00
Michael Niedermayer
073e771c9c Merge commit '33c859c142ef3f49b7a6227014ad92a680cf4d74'
* commit '33c859c142ef3f49b7a6227014ad92a680cf4d74':
  lavf: ignore attachment streams for interleaving purposes

Conflicts:
	libavformat/avformat.h
	libavformat/internal.h
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 15:37:05 +01:00
Michael Niedermayer
5144d91996 Merge commit '7b03b65bf0d02519c86750d2da33f413e11cf0c6'
* commit '7b03b65bf0d02519c86750d2da33f413e11cf0c6':
  lavf: do basic sanity checking on muxed packets

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 15:17:29 +01:00
Anton Khirnov
33c859c142 lavf: ignore attachment streams for interleaving purposes
Those streams should never get any packets by definition.
2014-02-04 11:17:06 +01:00
Anton Khirnov
7b03b65bf0 lavf: do basic sanity checking on muxed packets
Reject packets for non-existing or attachment streams.
2014-02-04 11:10:55 +01:00
Stefano Sabatini
5871ee5072 lavf: add output_ts_offset option to AVFormatContext
This option can be generally useful to set an output offset, needed when
setting an absolute index in the output.
2014-02-02 13:16:17 +01:00
Michael Niedermayer
e9a26dc5bf avformat/mux: fix "no tag found" check in validate_codec_tag()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-01 22:30:31 +01:00
Stefano Sabatini
d37d4b6e40 lavf/mux: improve feedback in case of no streams in muxer 2013-12-15 20:04:06 +01:00
James Almer
618bdb7f58 lavf/mux: Don't write "encoder" metadata tag when bitexact is requested
Since we don't write lavf's string when bitexact is requested, this will
prevent the tag from being copied from the source stream.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-06 19:33:41 +01:00
Michael Niedermayer
96e6447d62 Merge commit '596e5d4783ca951258a7c580951fd161f1785ec1'
* commit '596e5d4783ca951258a7c580951fd161f1785ec1':
  lavf: Add a flag to enable/disable per-packet flushing

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/version.h

This adds a 2nd API to set per packet flushing
If the user application indicates through either a non default then this non default takes
precedence over the other still default value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 12:01:35 +02:00
Luca Barbato
596e5d4783 lavf: Add a flag to enable/disable per-packet flushing
This is enabled by default and can be disabled with
"-fflags -flush_packets".

Inspired by a patch from Nicolas George <nicolas.george@normalesup.org>.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:11:08 +03:00
Michael Niedermayer
20be5e0a0e Merge commit '7950e519bb094897f957b9a9531cc60ba46cbc91'
* commit '7950e519bb094897f957b9a9531cc60ba46cbc91':
  Disable deprecation warnings for cases where a replacement is available

Conflicts:
	libavcodec/avpacket.c
	libavcodec/pthread.c
	libavcodec/utils.c
	libavdevice/v4l2.c
	libavfilter/avfiltergraph.c
	libavfilter/buffersrc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-03 10:08:30 +02:00
Diego Biurrun
7950e519bb Disable deprecation warnings for cases where a replacement is available 2013-08-02 19:19:02 +02:00
Stefano Sabatini
08b99be7c4 lavf/mux: rename variable cortag -> tagbuf2 in init_muxer()
Possibly enhance readibility.
2013-06-26 23:22:22 +02:00
Michael Niedermayer
f48366c704 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  lavf: don't abort if both encoder and muxer aspect ratios are not set

Conflicts:
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-24 11:42:42 +02:00
Rafaël Carré
e21307a2b0 lavf: don't abort if both encoder and muxer aspect ratios are not set
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-06-24 08:03:26 +02:00
Michael Niedermayer
8097307bfb Merge commit '12db891dcd57b305d6e3c1e22ea8204dc26edda1'
* commit '12db891dcd57b305d6e3c1e22ea8204dc26edda1':
  avf: move ff_write_chained to mux.c

Conflicts:
	libavformat/mux.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-16 23:58:59 +02:00
Luca Barbato
12db891dcd avf: move ff_write_chained to mux.c 2013-06-16 14:41:07 +02:00
Vignesh Venkatasubramanian
98c292a7a8 Adding support for encoding VP8 Alpha
This patch adds support for encoding VP8 files with alpha. The alpha channel
is encoded separately and the output is placed in AVPacket's side_data. The
muxer then muxes it into the BlockAdditional element of the matroska container.
More details on spec here: http://goo.gl/wCP1y

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-17 15:11:23 +02:00
Michael Niedermayer
efc08e00cc Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'
* commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110':
  vf_aspect: use the name 's' for the pointer to the private context
  Remove commented-out debug #define cruft

Conflicts:
	libavcodec/4xm.c
	libavcodec/dvdsubdec.c
	libavcodec/ituh263dec.c
	libavcodec/mpeg12.c
	libavfilter/avfilter.c
	libavfilter/vf_aspect.c
	libavfilter/vf_fieldorder.c
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-16 09:56:43 +02:00
Diego Biurrun
2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Michael Niedermayer
a5ba4e186b Merge commit 'e926b5ceb1962833f0c884a328382bc2eca67aff'
* commit 'e926b5ceb1962833f0c884a328382bc2eca67aff':
  avformat: Drop unnecessary ff_ name prefixes from static functions

Conflicts:
	libavformat/audiointerleave.c
	libavformat/mux.c
	libavformat/mxfenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-01 18:28:48 +02:00
Diego Biurrun
e926b5ceb1 avformat: Drop unnecessary ff_ name prefixes from static functions 2013-04-30 16:16:23 +02:00
Michael Niedermayer
ba323d67fa avformat/write_packet: drop disabled code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 14:57:56 +02:00
Michael Niedermayer
eba33396f0 avformat/mux: set avoid_negative_ts based on flags if not overridden by user or muxer
This changes the default to avoid negative timestamps.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 14:51:47 +02:00
Michael Niedermayer
647f306b46 avformat/mux: assert that timestamps are positive after offsetting them
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 14:51:47 +02:00
Michael Niedermayer
c329195a27 avformat/mux: use a local variable for offset
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 14:51:47 +02:00
Michael Niedermayer
060f14f493 avformat/mux: change avoid_negative_ts code to support later addition of AVStreams
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 14:51:47 +02:00
Michael Niedermayer
c4bf740225 Merge commit 'c2cb01d418dd18e1cf997c038d37378d773121be'
* commit 'c2cb01d418dd18e1cf997c038d37378d773121be':
  lavf: introduce AVFMT_TS_NEGATIVE

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	tests/ref/lavf/asf
	tests/ref/lavf/mkv
	tests/ref/lavf/mpg
	tests/ref/lavf/ts
	tests/ref/seek/lavf-asf
	tests/ref/seek/lavf-mkv
	tests/ref/seek/lavf-mpg
	tests/ref/seek/lavf-ts

This commit does not change the default ts behaviour, such
change will, if its done, be done separately.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 10:59:45 +02:00
Luca Barbato
c2cb01d418 lavf: introduce AVFMT_TS_NEGATIVE
Most formats do not support negative timestamps, shift them to avoid
unexpected behaviour and a number of bad crashes.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-04-25 10:13:27 +02:00
Michael Niedermayer
a286940da1 mux: also call avio_flush() when flushing the muxer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-08 13:31:12 +02:00
Nicolas George
4f112a8e34 lavf/mux: add the flush_packets option.
Note: a lot of muxers already do the flushing explicitly.
2013-03-24 23:19:07 +01:00
Michael Niedermayer
06a8350599 Merge commit '7b486ab13bfcfa88a7cd92586de50e49966ec292'
* commit '7b486ab13bfcfa88a7cd92586de50e49966ec292':
  lavf: remove disabled FF_API_AV_GETTIME cruft
  lavf: remove disabled FF_API_INTERLEAVE_PACKET cruft

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-13 12:37:03 +01:00
Anton Khirnov
32e5194969 lavf: remove disabled FF_API_INTERLEAVE_PACKET cruft 2013-03-11 18:23:10 +01:00
Michael Niedermayer
2653e12520 Merge commit '1afddbe59e96af75f1c07605afc95615569f388f'
* commit '1afddbe59e96af75f1c07605afc95615569f388f':
  avpacket: use AVBuffer to allow refcounting the packets.

Conflicts:
	libavcodec/avpacket.c
	libavcodec/utils.c
	libavdevice/v4l2.c
	libavformat/avidec.c
	libavformat/flacdec.c
	libavformat/id3v2.c
	libavformat/matroskaenc.c
	libavformat/mux.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-08 19:12:03 +01:00
Anton Khirnov
1afddbe59e avpacket: use AVBuffer to allow refcounting the packets.
This will allow us to avoid copying the packets in many cases.

This breaks ABI.
2013-03-08 07:33:45 +01:00
Michael Niedermayer
46730e7a0c mux/chunked interleaver: better align duration chunks.
This code causes the chunking to tend toward more optimal
alignment between streams.
The first chunks can still be less optimal aligned
2013-01-17 15:11:02 +01:00
Michael Niedermayer
69a96f9d4c mux: de-obfuscate chunked interleaver checks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 15:08:50 +01:00
Michael Niedermayer
c57c1329a9 mux: simplify chunking interleaver code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-17 14:45:30 +01:00
Michael Niedermayer
1191db31c1 mux: fix chunked interleaver
The code did not account properly for packets that where added to
the end of the packet list. Also flags for such packets where not
set correctly leading to incorrect chunked interleaving.

Reported-by: bcoudurier
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 20:22:58 +01:00
Michael Niedermayer
cae11e4031 mux: fix chunked_duration rounding anomaly
a small value was rounded to 0 and then treated special as if
chunked_duration was 0. This led to a inconsistency that further led
to wrong interleaving

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-16 13:49:02 +01:00
Michael Niedermayer
d641ee94b5 lavf: Fix assignments in if()
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-01-14 13:12:55 +02:00
Michael Niedermayer
1ac5a8d7e3 lavf/mux: Fix assignments in if()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-14 05:05:41 +01:00
Clément Bœsch
119d70db50 lavf/mux: do not pass a copy of the packet to write_packet().
Sometimes the muxer modifies the packet, like for instance lavf/mp3enc
changing pkt->destruct in order to keep a copy. These changes must be
kept, even though the muxer behaviour is questionable. Regression since
0072116.

Fixes #2124.
2013-01-08 23:21:05 +01:00
Clément Bœsch
0072116ccb lavf: split packets before muxing.
After demuxing, data and side are merged. Before decoding, they are
split. Encoder will perform with data and side split. This means that a
muxer can receive split data (after encoding) but also merged data (if
called directly after demuxing). This commit makes sure data and side
are split for the muxer.
2012-12-20 16:13:52 +01:00
Michael Niedermayer
f2a7e1a62b mux: change 1 assert->av_assert1()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-07 23:31:27 +02:00
Michael Niedermayer
5e6439a125 ff_choose_timebase: only try factors upto 14
otherwise a unexpected timebase could be choosen
that is one that is thousand times more precisse than requested
which can have sideeffects.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-03 21:38:56 +02:00
Michael Niedermayer
de707bc8bd mux/nut: factorize ff_choose_timebase() out of nut
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-03 21:34:43 +02:00
Michael Niedermayer
dd78e1090b Merge commit '1e46c63eb72be752e044ba32257d77f35cbd9dac'
* commit '1e46c63eb72be752e044ba32257d77f35cbd9dac':
  avformat: refactor avformat_write_header

Conflicts:
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-02 18:48:56 +02:00
Michael Niedermayer
6cbbf4a274 Merge commit '86bbdf865e04bc5ddc2021b0620e6de634375253'
* commit '86bbdf865e04bc5ddc2021b0620e6de634375253':
  avformat: refactor avformat_write_header

Conflicts:
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-02 18:36:09 +02:00