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

Sergey Volk servolk at chromium.org
Sat Mar 5 01:19:18 CET 2016


Ok, something like this for now, then?
I'm new to ffmpeg development. When is the next version bump going to happen?
---
 libavformat/matroskadec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index d20568c..4c3e53a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1856,6 +1856,9 @@ static int matroska_parse_tracks(AVFormatContext *s)
             return AVERROR(ENOMEM);
         }

+        if (track->num <= INT_MAX)
+          st->id = (int) track->num;
+
         if (key_id_base64) {
             /* export encryption key id as base64 metadata tag */
             av_dict_set(&st->metadata, "enc_key_id", key_id_base64, 0);
-- 
2.7.0.rc3.207.g0ac5344

On Thu, Mar 3, 2016 at 2:14 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> wm4 <nfxjfg <at> googlemail.com> writes:
>
>> > +        st->id = (int) track->num;
>
>> Might be better after all not to set the id if it's out of range?
>
> Yes, please.
>
> While there, the id field could be changed to 64bit with the
> next version bump.
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list