forked from HandBrake/HandBrake
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrib: update to FFmpeg snapshot 20240322 rev 114301.
- Loading branch information
Showing
25 changed files
with
177 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
From 228b17a1f5f4d3d82c5beca4fc57016c3d582c64 Mon Sep 17 00:00:00 2001 | ||
From db9aacd530340e44e3202c2aeba0ee18f6b09fe5 Mon Sep 17 00:00:00 2001 | ||
From: John Stebbins <[email protected]> | ||
Date: Fri, 21 May 2021 14:12:07 +0200 | ||
Subject: [PATCH 1/5] [PATCH 1/3] mov: read 'name' track tag written by movenc | ||
Date: Wed, 20 Mar 2024 09:07:15 +0100 | ||
Subject: [PATCH 01/16] mov: read 'name' track tag written by movenc. | ||
|
||
--- | ||
libavformat/mov.c | 26 +++++++++++++++++--------- | ||
1 file changed, 17 insertions(+), 9 deletions(-) | ||
|
||
diff --git a/libavformat/mov.c b/libavformat/mov.c | ||
index 38a7058..1546867 100644 | ||
index 8d1135270c..e91da339ee 100644 | ||
--- a/libavformat/mov.c | ||
+++ b/libavformat/mov.c | ||
@@ -308,6 +308,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
@@ -336,6 +336,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL; | ||
int raw = 0; | ||
int num = 0; | ||
+ AVDictionary *metadata; | ||
|
||
switch (atom.type) { | ||
case MKTAG( '@','P','R','M'): key = "premiere_version"; raw = 1; break; | ||
@@ -340,6 +341,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
@@ -368,6 +369,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
return mov_metadata_loci(c, pb, atom.size); | ||
case MKTAG( 'm','a','n','u'): key = "make"; break; | ||
case MKTAG( 'm','o','d','l'): key = "model"; break; | ||
+ case MKTAG( 'n','a','m','e'): key = "title"; raw = 1; break; | ||
case MKTAG( 'p','c','s','t'): key = "podcast"; | ||
parse = mov_metadata_int8_no_padding; break; | ||
case MKTAG( 'p','g','a','p'): key = "gapless_playback"; | ||
@@ -515,17 +517,23 @@ retry: | ||
@@ -553,17 +555,23 @@ retry: | ||
} | ||
str[str_size] = 0; | ||
} | ||
|
@@ -61,5 +61,5 @@ index 38a7058..1546867 100644 | |
} | ||
|
||
-- | ||
2.30.1 (Apple Git-130) | ||
2.39.3 (Apple Git-146) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
From 95a64ac34f4273b32f2eeabbdf28b40bf0bf6391 Mon Sep 17 00:00:00 2001 | ||
From: Damiano galassi <damiog@gmail.com> | ||
Date: Tue, 28 Feb 2023 11:20:07 +0100 | ||
Subject: [PATCH 1/3] movenc: write 3gpp track 'titl' tag | ||
From fbd97ecdb9e6f58770768355635c5ffda64b4a2b Mon Sep 17 00:00:00 2001 | ||
From: John Stebbins <jstebbins@jetheaddev.com> | ||
Date: Wed, 20 Mar 2024 09:08:52 +0100 | ||
Subject: [PATCH 02/16] movenc: write 3gpp track 'titl' tag | ||
|
||
Apple software used to use 'name' raw tag for track titles. When they | ||
rewrote everything with AVFoundation, they switched to using 3gpp 'titl' | ||
tag for track titles and 'name' no longer works. | ||
|
||
Original patch by John Stebbins <[email protected]> | ||
Apple software used to use 'name' raw tag for track titles. When they rewrote everything with AVFoundation, they switched to using 3gpp 'titl' tag for track titles and 'name' no longer works. | ||
--- | ||
libavformat/movenc.c | 77 ++++++++++++++++++++++---------------------- | ||
1 file changed, 39 insertions(+), 38 deletions(-) | ||
|
||
diff --git a/libavformat/movenc.c b/libavformat/movenc.c | ||
index 319f02b..cba6ce1 100644 | ||
index 724a1eb673..f7192002f1 100644 | ||
--- a/libavformat/movenc.c | ||
+++ b/libavformat/movenc.c | ||
@@ -3567,6 +3567,34 @@ static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track) | ||
@@ -3761,6 +3761,34 @@ static int mov_write_udta_sdp(AVIOContext *pb, MOVTrack *track) | ||
return len + 24; | ||
} | ||
|
||
|
@@ -51,7 +47,7 @@ index 319f02b..cba6ce1 100644 | |
static int mov_write_track_metadata(AVIOContext *pb, AVStream *st, | ||
const char *tag, const char *str) | ||
{ | ||
@@ -3641,8 +3669,10 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, | ||
@@ -3835,8 +3863,10 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, | ||
if (ret < 0) | ||
return ret; | ||
|
||
|
@@ -63,7 +59,7 @@ index 319f02b..cba6ce1 100644 | |
|
||
if (mov->mode & MODE_MP4) { | ||
if ((ret = mov_write_track_kinds(pb_buf, st)) < 0) | ||
@@ -4240,35 +4270,6 @@ static int ascii_to_wc(AVIOContext *pb, const uint8_t *b) | ||
@@ -4433,35 +4463,6 @@ static int ascii_to_wc(AVIOContext *pb, const uint8_t *b) | ||
return 0; | ||
} | ||
|
||
|
@@ -99,7 +95,7 @@ index 319f02b..cba6ce1 100644 | |
static int mov_write_chpl_tag(AVIOContext *pb, AVFormatContext *s) | ||
{ | ||
int64_t pos = avio_tell(pb); | ||
@@ -4307,14 +4308,14 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, | ||
@@ -4500,14 +4501,14 @@ static int mov_write_udta_tag(AVIOContext *pb, MOVMuxContext *mov, | ||
return ret; | ||
|
||
if (mov->mode & MODE_3GP) { | ||
|
@@ -123,5 +119,5 @@ index 319f02b..cba6ce1 100644 | |
} else if (mov->mode == MODE_MOV && !(mov->flags & FF_MOV_FLAG_USE_MDTA)) { // the title field breaks gtkpod with mp4 and my suspicion is that stuff is not valid in mp4 | ||
mov_write_string_metadata(s, pb_buf, "\251ART", "artist", 0); | ||
-- | ||
2.37.1 (Apple Git-137.1) | ||
2.39.3 (Apple Git-146) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
From 69339799f416dfb95866d3ab50d4adbf0b7c1871 Mon Sep 17 00:00:00 2001 | ||
From: Damiano galassi <damiog@gmail.com> | ||
Date: Tue, 28 Feb 2023 11:20:25 +0100 | ||
Subject: [PATCH 2/3] mov: read 3gpp udta tags. | ||
From b7e3621fdc939b60aae1dbea1a48c7274d7e494a Mon Sep 17 00:00:00 2001 | ||
From: John Stebbins <jstebbins@jetheaddev.com> | ||
Date: Wed, 20 Mar 2024 09:09:41 +0100 | ||
Subject: [PATCH 03/16] mov: read 3gpp udta tags. | ||
|
||
Original patch by John Stebbins <[email protected]>. | ||
--- | ||
libavformat/mov.c | 101 ++++++++++++++++++++++++++++++++++++++++++++-- | ||
1 file changed, 98 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/libavformat/mov.c b/libavformat/mov.c | ||
index 978d995..4bffdac 100644 | ||
index e91da339ee..f9012db994 100644 | ||
--- a/libavformat/mov.c | ||
+++ b/libavformat/mov.c | ||
@@ -55,6 +55,7 @@ | ||
|
@@ -20,7 +19,7 @@ index 978d995..4bffdac 100644 | |
#include "internal.h" | ||
#include "avio_internal.h" | ||
#include "demux.h" | ||
@@ -296,6 +297,73 @@ static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len) | ||
@@ -325,6 +326,73 @@ static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len) | ||
return 0; | ||
} | ||
|
||
|
@@ -94,7 +93,7 @@ index 978d995..4bffdac 100644 | |
static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
{ | ||
char tmp_key[AV_FOURCC_MAX_STRING_SIZE] = {0}; | ||
@@ -321,15 +389,33 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
@@ -350,15 +418,33 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
case MKTAG( 'c','a','t','g'): key = "category"; break; | ||
case MKTAG( 'c','p','i','l'): key = "compilation"; | ||
parse = mov_metadata_int8_no_padding; break; | ||
|
@@ -131,7 +130,7 @@ index 978d995..4bffdac 100644 | |
case MKTAG( 'h','d','v','d'): key = "hd_video"; | ||
parse = mov_metadata_int8_no_padding; break; | ||
case MKTAG( 'H','M','M','T'): | ||
@@ -400,6 +486,15 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
@@ -429,6 +515,15 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) | ||
case MKTAG(0xa9,'w','r','n'): key = "warning"; break; | ||
case MKTAG(0xa9,'w','r','t'): key = "composer"; break; | ||
case MKTAG(0xa9,'x','y','z'): key = "location"; break; | ||
|
@@ -148,5 +147,5 @@ index 978d995..4bffdac 100644 | |
retry: | ||
if (c->itunes_metadata && atom.size > 8) { | ||
-- | ||
2.37.1 (Apple Git-137.1) | ||
2.39.3 (Apple Git-146) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,16 @@ | ||
From 7662ce6bcda9f153b164ef57fdadcc5ce6a21088 Mon Sep 17 00:00:00 2001 | ||
From: Damiano galassi <damiog@gmail.com> | ||
Date: Tue, 28 Feb 2023 11:23:18 +0100 | ||
Subject: [PATCH 3/3] movenc: write 3gpp track names tags for all available | ||
From e918e84253888fdefb68191e7da20c840ccf13f6 Mon Sep 17 00:00:00 2001 | ||
From: John Stebbins <jstebbins@jetheaddev.com> | ||
Date: Wed, 20 Mar 2024 09:10:27 +0100 | ||
Subject: [PATCH 04/16] movenc: write 3gpp track names tags for all available | ||
languages | ||
|
||
Metadata keys can have a language suffix. Iterate through all language | ||
variations of the metadata key. | ||
|
||
Original patch by John Stebbins <[email protected]>. | ||
Metadata keys can have a language suffix. Iterate through all language variations of the metadata key. | ||
--- | ||
libavformat/movenc.c | 25 +++++++++++++++++++++++-- | ||
1 file changed, 23 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/libavformat/movenc.c b/libavformat/movenc.c | ||
index cba6ce1..3e680c4 100644 | ||
index f7192002f1..167536de75 100644 | ||
--- a/libavformat/movenc.c | ||
+++ b/libavformat/movenc.c | ||
@@ -28,6 +28,7 @@ | ||
|
@@ -24,7 +21,7 @@ index cba6ce1..3e680c4 100644 | |
#include "avio_internal.h" | ||
#include "dovi_isom.h" | ||
#include "riff.h" | ||
@@ -3586,7 +3587,14 @@ static int mov_write_3gp_udta_tag(AVIOContext *pb, AVDictionary *metadata, | ||
@@ -3780,7 +3781,14 @@ static int mov_write_3gp_udta_tag(AVIOContext *pb, AVDictionary *metadata, | ||
if (!strcmp(tag, "yrrc")) | ||
avio_wb16(pb, atoi(t->value)); | ||
else { | ||
|
@@ -40,7 +37,7 @@ index cba6ce1..3e680c4 100644 | |
avio_write(pb, t->value, strlen(t->value) + 1); /* UTF8 string value */ | ||
if (!strcmp(tag, "albm") && | ||
(t = av_dict_get(metadata, "track", NULL, 0))) | ||
@@ -3670,8 +3678,21 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, | ||
@@ -3864,8 +3872,21 @@ static int mov_write_track_udta_tag(AVIOContext *pb, MOVMuxContext *mov, | ||
return ret; | ||
|
||
if (mov->mode & (MODE_MP4|MODE_MOV)) { | ||
|
@@ -64,5 +61,5 @@ index cba6ce1..3e680c4 100644 | |
|
||
if (mov->mode & MODE_MP4) { | ||
-- | ||
2.37.1 (Apple Git-137.1) | ||
2.39.3 (Apple Git-146) | ||
|
10 changes: 4 additions & 6 deletions
10
contrib/ffmpeg/A05-dvdsubdec-fix-processing-of-partial-packets.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
...dec-do-not-discard-zero-sized-rects.patch → ...dec-do-not-discard-zero-sized-rects.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
From 78b2d7bf731c6be284fc16c93012eb84eac867fe Mon Sep 17 00:00:00 2001 | ||
From 86431df08fe51ebf123305714939d0495fe1044b Mon Sep 17 00:00:00 2001 | ||
From: Damiano Galassi <[email protected]> | ||
Date: Fri, 8 Mar 2024 08:40:08 +0100 | ||
Subject: [PATCH] dvdsubdec: add an option to output subtitles with empty or | ||
fully transparent rects. | ||
Date: Wed, 20 Mar 2024 09:14:19 +0100 | ||
Subject: [PATCH 08/16] dvdsubdec: add an option to output subtitles with | ||
empty or fully transparent rects. | ||
|
||
--- | ||
libavcodec/dvdsubdec.c | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c | ||
index bee42e3c61..b3ce026d16 100644 | ||
index 2dd10b4d8b..aa4b1367d2 100644 | ||
--- a/libavcodec/dvdsubdec.c | ||
+++ b/libavcodec/dvdsubdec.c | ||
@@ -43,6 +43,7 @@ typedef struct DVDSubContext | ||
uint8_t buf[0x10000]; | ||
int buf_size; | ||
@@ -45,6 +45,7 @@ typedef struct DVDSubContext | ||
int forced_subs_only; | ||
+ int output_empty_rects; | ||
uint8_t used_color[256]; | ||
int64_t pts; | ||
+ int output_empty_rects; | ||
} DVDSubContext; | ||
|
||
@@ -558,7 +559,7 @@ static int dvdsub_decode(AVCodecContext *avctx, AVSubtitle *sub, | ||
|
||
static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values) | ||
@@ -568,7 +569,7 @@ static int dvdsub_decode(AVCodecContext *avctx, AVSubtitle *sub, | ||
ctx->pts = AV_NOPTS_VALUE; | ||
return buf_size; | ||
} | ||
- if (!is_menu && find_smallest_bounding_rectangle(ctx, sub) == 0) | ||
+ if (!is_menu && !ctx->output_empty_rects && find_smallest_bounding_rectangle(ctx, sub) == 0) | ||
goto no_subtitle; | ||
|
||
if (ctx->forced_subs_only && !(sub->rects[0]->flags & AV_SUBTITLE_FLAG_FORCED)) | ||
@@ -707,6 +708,7 @@ static const AVOption options[] = { | ||
@@ -720,6 +721,7 @@ static const AVOption options[] = { | ||
{ "palette", "set the global palette", OFFSET(palette_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD }, | ||
{ "ifo_palette", "obtain the global palette from .IFO file", OFFSET(ifo_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD }, | ||
{ "forced_subs_only", "Only show forced subtitles", OFFSET(forced_subs_only), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, SD}, | ||
|
Oops, something went wrong.