[FFmpeg-devel] [PATCH 09/11] avformat/mux: Restore stream ts in av_write_packet on EAGAIN

Michael Niedermayer michael at niedermayer.cc
Thu Sep 1 02:44:17 EEST 2016


On Tue, Aug 02, 2016 at 03:24:20PM +0200, sebechlebskyjan at gmail.com wrote:
> From: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> 
> compute_muxer_pkt_fields() stores the last seen timestamps in stream
> and produces error if the same timestamp is presented again.
> This is a problem if muxer works in non-blocking mode and calls
> av_write_packet repeatedly with the same packet.
> This patch saves stream fields affected by compute_muxer_pkt_fields
> and restores them in case AVERROR(EAGAIN) is returned from
> write_packet, and muxer has AVFMT_FLAG_NONBLOCK flag set.
> 
> Signed-off-by: Jan Sebechlebsky <sebechlebskyjan at gmail.com>
> ---
>  libavformat/mux.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)

isnt it simpler instead of all the safe and restore to simply skip
compute_muxer_pkt_fields() on (a) subsequent call(s)?
or does that not work ?

iam also thinking that it would be more robust if one considers future
changes that would require more things to be safed and restored

but if thats messier and not simple then this patch
LGTM

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160901/da042621/attachment.sig>


More information about the ffmpeg-devel mailing list