Skip to content

Commit

Permalink
Fix chapter embedding (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihil-admirari committed Oct 22, 2023
1 parent 9bdb454 commit fc396ba
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ These patches have been applied to the builds:
by [@tpikonen](https://github.com/tpikonen).
Fixes [yt-dlp#4127](https://github.com/yt-dlp/yt-dlp/issues/4127), [FFmpeg#8684](https://trac.ffmpeg.org/ticket/8684)

### 2. Chapter embedding regression

by [@bashonly](https://github.com/bashonly).
Fixes [FFmpeg#10482](https://trac.ffmpeg.org/ticket/10482)


## Release-only patches
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 4629460590960d09ad5ac06c9bd34b45836b290b Mon Sep 17 00:00:00 2001
From: bashonly <[email protected]>
Date: Sat, 21 Oct 2023 23:51:48 +0300
Subject: [PATCH 1/2] Revert "fftools/ffmpeg_mux_init: Use all metadata
selectors if none is specified."

This reverts commit 653ee3f159411a1b97c19b96393a39f29569ed99.
---
fftools/ffmpeg_mux_init.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index ab2d1d89e4..4cf18b4f02 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -2182,11 +2182,11 @@ static int copy_metadata(Muxer *mux, AVFormatContext *ic,
if (ret < 0)
return ret;

- if (type_in == 'g' || type_out == 'g' || !*outspec)
+ if (type_in == 'g' || type_out == 'g')
*metadata_global_manual = 1;
- if (type_in == 's' || type_out == 's' || !*outspec)
+ if (type_in == 's' || type_out == 's')
*metadata_streams_manual = 1;
- if (type_in == 'c' || type_out == 'c' || !*outspec)
+ if (type_in == 'c' || type_out == 'c')
*metadata_chapters_manual = 1;

/* ic is NULL when just disabling automatic mappings */
--
2.39.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 76899a7a6dbdee5b85a2cc17942e9fef9abdf73e Mon Sep 17 00:00:00 2001
From: bashonly <[email protected]>
Date: Sat, 21 Oct 2023 23:51:55 +0300
Subject: [PATCH 2/2] Revert "fftools/ffmpeg_mux_init: drop a duplicated block
in copy_metadata()"

This reverts commit 3c7dd5ed37da6d2de06c4850de5a319ca9cdd47f.
---
fftools/ffmpeg_mux_init.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 4cf18b4f02..4664ad9baa 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -2182,6 +2182,16 @@ static int copy_metadata(Muxer *mux, AVFormatContext *ic,
if (ret < 0)
return ret;

+ if (!ic) {
+ if (type_out == 'g' || !*outspec)
+ *metadata_global_manual = 1;
+ if (type_out == 's' || !*outspec)
+ *metadata_streams_manual = 1;
+ if (type_out == 'c' || !*outspec)
+ *metadata_chapters_manual = 1;
+ return 0;
+ }
+
if (type_in == 'g' || type_out == 'g')
*metadata_global_manual = 1;
if (type_in == 's' || type_out == 's')
--
2.39.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 71b32fb6b36188c699b169af49a3ddb2f71bddf3 Mon Sep 17 00:00:00 2001
From: bashonly <[email protected]>
Date: Sun, 22 Oct 2023 12:58:53 +0300
Subject: [PATCH] Revert "fftools/ffmpeg_mux_init: drop a duplicated block in
copy_metadata()"

This reverts commit 3c7dd5ed37da6d2de06c4850de5a319ca9cdd47f.
---
fftools/ffmpeg_mux_init.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index e42d5ff26a..1a9611d19d 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -1822,6 +1822,16 @@ static int copy_metadata(Muxer *mux, AVFormatContext *ic,
parse_meta_type(mux, inspec, &type_in, &idx_in, &istream_spec);
parse_meta_type(mux, outspec, &type_out, &idx_out, &ostream_spec);

+ if (!ic) {
+ if (type_out == 'g' || !*outspec)
+ *metadata_global_manual = 1;
+ if (type_out == 's' || !*outspec)
+ *metadata_streams_manual = 1;
+ if (type_out == 'c' || !*outspec)
+ *metadata_chapters_manual = 1;
+ return 0;
+ }
+
if (type_in == 'g' || type_out == 'g')
*metadata_global_manual = 1;
if (type_in == 's' || type_out == 's')
--
2.39.2

0 comments on commit fc396ba

Please sign in to comment.