[FFmpeg-devel] [PATCH] lavf: make compute_pkt_fields2() return meaningful error values
Michael Niedermayer
michaelni at gmx.at
Mon Mar 21 03:04:14 CET 2011
On Sun, Mar 20, 2011 at 06:34:27PM +0100, Stefano Sabatini wrote:
> On date Tuesday 2011-03-15 13:12:08 +0100, Stefano Sabatini wrote:
> > ---
> > libavformat/utils.c | 6 +++---
> > 1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavformat/utils.c b/libavformat/utils.c
> > index ccaf77d..193707f 100644
> > --- a/libavformat/utils.c
> > +++ b/libavformat/utils.c
> > @@ -2918,7 +2918,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
> > pkt->pts, pkt->dts, st->cur_dts, delay, pkt->size, pkt->stream_index);
> >
> > /* if(pkt->pts == AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE)
> > - return -1;*/
> > + return AVERROR(EINVAL);*/
> >
> > /* duration field */
> > if (pkt->duration == 0) {
> > @@ -2953,11 +2953,11 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
> > av_log(s, AV_LOG_ERROR,
> > "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %"PRId64" >= %"PRId64"\n",
> > st->index, st->cur_dts, pkt->dts);
> > - return -1;
> > + return AVERROR(EINVAL);
> > }
> > if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts < pkt->dts){
> > av_log(s, AV_LOG_ERROR, "pts < dts in stream %d\n", st->index);
> > - return -1;
> > + return AVERROR(EINVAL);
> > }
> >
> > // av_log(s, AV_LOG_DEBUG, "av_write_frame: pts2:%"PRId64" dts2:%"PRId64"\n", pkt->pts, pkt->dts);
>
> Ping?
no objection, not sure the new error codes are ideal though but i cant really
name better ones
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110321/45d64a5e/attachment-0001.asc>
More information about the ffmpeg-devel
mailing list