diff mbox series

[FFmpeg-devel,1/5] avformat/aiffenc: Don't forget chapters

Message ID 20200519104601.12817-1-andreas.rheinhardt@gmail.com
State Accepted
Commit 1ebbb493cced1af3fc891618e2573c7bc5ed7e70
Headers show
Series [FFmpeg-devel,1/5] avformat/aiffenc: Don't forget chapters | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 19, 2020, 10:45 a.m. UTC
If the write_id3v2 option is set, the aiff muxer would write id3v2 tags
if there is global metadata or if there are attached pics to write.
Chapters are ignored in this check that precedes writing id3v2 tags.
Yet 47ac344970f1d6ef149c4b8a883b68cdb15112c2 added support for writing
chapters as id3v2 tags, so one should check for the existence of chapters,
too; otherwise the chapters would only be written in case there is
global metadata or an attached pic.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/aiffenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Rheinhardt May 23, 2020, 4:51 a.m. UTC | #1
Andreas Rheinhardt:
> If the write_id3v2 option is set, the aiff muxer would write id3v2 tags
> if there is global metadata or if there are attached pics to write.
> Chapters are ignored in this check that precedes writing id3v2 tags.
> Yet 47ac344970f1d6ef149c4b8a883b68cdb15112c2 added support for writing
> chapters as id3v2 tags, so one should check for the existence of chapters,
> too; otherwise the chapters would only be written in case there is
> global metadata or an attached pic.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/aiffenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
> index 0145596bec..88c45df334 100644
> --- a/libavformat/aiffenc.c
> +++ b/libavformat/aiffenc.c
> @@ -49,7 +49,7 @@ static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff)
>      AVIOContext *pb = s->pb;
>      AVPacketList *pict_list = aiff->pict_list;
>  
> -    if (!s->metadata && !aiff->pict_list)
> +    if (!s->metadata && !s->nb_chapters && !aiff->pict_list)
>          return 0;
>  
>      avio_wl32(pb, MKTAG('I', 'D', '3', ' '));
> 
Will apply the rest of this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 0145596bec..88c45df334 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -49,7 +49,7 @@  static int put_id3v2_tags(AVFormatContext *s, AIFFOutputContext *aiff)
     AVIOContext *pb = s->pb;
     AVPacketList *pict_list = aiff->pict_list;
 
-    if (!s->metadata && !aiff->pict_list)
+    if (!s->metadata && !s->nb_chapters && !aiff->pict_list)
         return 0;
 
     avio_wl32(pb, MKTAG('I', 'D', '3', ' '));