[FFmpeg-devel] [PATCH 1/5] lavf: add FFERROR_REDO to let demuxer return no packet.

Michael Niedermayer michaelni at gmx.at
Sat Nov 28 04:14:22 CET 2015


On Fri, Nov 27, 2015 at 07:16:06PM +0100, Nicolas George wrote:
> Signed-off-by: Nicolas George <george at nsup.org>
> ---
>  libavformat/internal.h | 6 ++++++
>  libavformat/utils.c    | 5 +++++
>  2 files changed, 11 insertions(+)
> 
> 
> Apparently, the most unhappyness was caused by the error code in the public
> API. This is not the case here.
> 
> 
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index ee86094..0f684bd 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -516,4 +516,10 @@ int ff_copy_whitelists(AVFormatContext *dst, AVFormatContext *src);
>  int ffio_open2_wrapper(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags,
>                         const AVIOInterruptCB *int_cb, AVDictionary **options);
>  
> +/**
> + * Returned by demuxers to indicate that data was consumed but discarded
> + * (ignored streams or junk data). The framework will re-call the demuxer.
> + */
> +#define FFERROR_REDO FFERRTAG( 'R','E','D','O')
> +
>  #endif /* AVFORMAT_INTERNAL_H */
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 8cb7d38..83e2f73 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -680,6 +680,11 @@ int ff_read_packet(AVFormatContext *s, AVPacket *pkt)
>          av_init_packet(pkt);
>          ret = s->iformat->read_packet(s, pkt);
>          if (ret < 0) {
> +            /* Some demuxer (FLV, MPEG-PS) return FFERROR_REDO when they

i dont think specific demuxers should be listed here, the list
would become outdated

patch LGTM otherwise

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20151128/761e047d/attachment.sig>


More information about the ffmpeg-devel mailing list