[FFmpeg-devel] [PATCH] Use matroska TrackNumber for populating AVStream::id

Nicolas George george at nsup.org
Thu Mar 10 09:19:14 CET 2016


Thanks for the patch.

Le decadi 20 ventôse, an CCXXIV, Sergey Volk a écrit :
> I have also bumped the major version to 58 locally in version.h, and
> re-ran make with the stream id being int64_t and fixed all new
> warnings that showed up (only saw new warnings related to the
> incorrect format being used for int64_t value).

Commit messages are usually written in an impersonal form. Remember that
they will stay. That does not matter much.

>                  av_log(avf, AV_LOG_VERBOSE,
> -                       "Match slave stream #%d with stream #%d id 0x%x\n",
> -                       i, j, st->id);
> +#if FF_API_OLD_INT32_STREAM_ID
> +                       "Match slave stream #%d with stream #%d id 0x%x\n"
> +#else
> +                       "Match slave stream #%d with stream #%d id
> 0x%"PRIx64"\n"
> +#endif
> +                       , i, j, st->id);

You could do much simpler by casting the id unconditionally to int64_t:

    /* TODO remove cast after FF_API_OLD_INT32_STREAM_ID removal */
    av_log(... "0x%"PRIx64"\n", (int64_t)st->id);

(I would put the comment at each place the cast is used, to ease finding all
the casts that can be removed.)

As a side note, I wonder if uint64_t would not be better than the signed
variant.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160310/38916cb3/attachment.sig>


More information about the ffmpeg-devel mailing list