[FFmpeg-devel] [PATCH]Write total number of tracks to m4a

Michael Niedermayer michaelni at gmx.at
Thu Aug 1 01:52:56 CEST 2013


On Thu, Aug 01, 2013 at 12:29:58AM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes ticket #2157 for me.
> 
> Please comment, Carl Eugen

sould be ok

>  movenc.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 8da3f932db6a70d1f85548740f12623e7adc4a68  patchtrkn.diff
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 42ec3f2..1b3cebb 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -2022,6 +2022,12 @@ static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov,
>      AVDictionaryEntry *t = av_dict_get(s->metadata, "track", NULL, 0);
>      int size = 0, track = t ? atoi(t->value) : 0;
>      if (track) {
> +        int i = 1, tracks = 0;
> +        while (t->value[i])
> +            if (t->value[i++] == '/') {
> +                tracks = atoi(&t->value[i]);
> +                break;

might be simpler with strchr()
otherwise LGTM

[..]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- 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/20130801/0e18d859/attachment.asc>


More information about the ffmpeg-devel mailing list