[FFmpeg-devel] [PATCH] nuvdemux: timestamps are signed or well wraped and starting before 0.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Nov 25 12:48:09 CET 2012


On Sun, Nov 25, 2012 at 05:02:30AM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavformat/nuv.c            |    4 +-
>  tests/ref/fate/nuv-rtjpeg-fh |  100 +++++++++++++++++++++---------------------
>  2 files changed, 52 insertions(+), 52 deletions(-)
> 
> diff --git a/libavformat/nuv.c b/libavformat/nuv.c
> index c67c1fa..2b2f22c 100644
> --- a/libavformat/nuv.c
> +++ b/libavformat/nuv.c
> @@ -229,7 +229,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
>  
>                  pkt->pos = pos;
>                  pkt->flags |= hdr[2] == 0 ? AV_PKT_FLAG_KEY : 0;
> -                pkt->pts = AV_RL32(&hdr[4]);
> +                pkt->pts = (int32_t)AV_RL32(&hdr[4]);

Maybe I am overly pedantic, but isn't this cast strictly speaking
undefined? It seems to me we use (e.g. in dsicinav.c) constructs like
sign_extend(AV_RL16(buf), 16); instead of casts.
Also a test-case/explanation would be nice, because the FATE reference
at first sight looks a lot worse, not better and it's fairly non-obvious
why this cases the timestamps to be offset by 80...


More information about the ffmpeg-devel mailing list