[FFmpeg-devel] [PATCH 1/3] utils.c: when packets are written by s->oformat->write_packet( ), add output packet size to out_bytes.

Nicolas George nicolas.george at normalesup.org
Tue Aug 14 23:49:50 CEST 2012


L'octidi 28 thermidor, an CCXX, Michael Smithng a écrit :
> The return values (considering the changes to ffmpeg.c) are being used.
> This is how we're getting the actual number of bytes written to the ost
> rather than just bytes decoded.
> 
> The return value is still consistent with the way it's being used
> elsewhere in the code. Previously the return value was either 0 for
> success or negative for an error. It's still positive for success but now
> can have a non-zero value. Since the value was checked for negative or
> positive, this will not affect its use.

The docs says:

 * @return 0 on success, a negative AVERROR on error.

There are certainly some applications out in the world that check it as
"if (ret)" and not "if (ret < 0)", such a change would break them.

> We tried using AVPacket.size but the return values were less than useful
> for the purpose.

A quick look into the code seems to indicate that the problem lies in the
implementation of the RTSP protocol, that does not update the pos field of
the "main" protocol according to the progress of the individual streams.

Regards,

-- 
  Nicolas George
-------------- 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/20120814/44836bf0/attachment.asc>


More information about the ffmpeg-devel mailing list