mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
Remove patches for ancient versions of ffmpeg
This commit is contained in:
parent
edaa8fe4f2
commit
92022d82f7
@ -1,97 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Patch for ffmpeg so forked-daapd can extract iTunes TV metadata from mp4 video files
|
||||
# Ace Jones <ace.jones1@yahoo.com>
|
||||
#
|
||||
# Usage: chmod +x this file, and run it from the directory above where you want ffmpeg
|
||||
#
|
||||
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
|
||||
patch -p0 < $0
|
||||
exit
|
||||
Index: ffmpeg/libavformat/mov.c
|
||||
===================================================================
|
||||
--- ffmpeg/libavformat/mov.c (revision 20790)
|
||||
+++ ffmpeg/libavformat/mov.c (working copy)
|
||||
@@ -80,19 +80,45 @@
|
||||
|
||||
static const MOVParseTableEntry mov_default_parse_table[];
|
||||
|
||||
-static int mov_metadata_trkn(MOVContext *c, ByteIOContext *pb, unsigned len)
|
||||
+static int mov_metadata_trkn(MOVContext *c, ByteIOContext *pb, unsigned len, const char *key)
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
get_be16(pb); // unknown
|
||||
snprintf(buf, sizeof(buf), "%d", get_be16(pb));
|
||||
- av_metadata_set(&c->fc->metadata, "track", buf);
|
||||
+ av_metadata_set(&c->fc->metadata, key, buf);
|
||||
|
||||
get_be16(pb); // total tracks
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int mov_metadata_int8(MOVContext *c, ByteIOContext *pb, unsigned len, const char *key)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+
|
||||
+ /* bypass padding bytes */
|
||||
+ get_byte(pb);
|
||||
+ get_byte(pb);
|
||||
+ get_byte(pb);
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf-1), "%hu", get_byte(pb));
|
||||
+ buf[sizeof(buf)-1] = 0;
|
||||
+ av_metadata_set(&c->fc->metadata, key, buf);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mov_metadata_stik(MOVContext *c, ByteIOContext *pb, unsigned len, const char *key)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf-1), "%hu", get_byte(pb));
|
||||
+ buf[sizeof(buf)-1] = 0;
|
||||
+ av_metadata_set(&c->fc->metadata, key, buf);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
static int mov_read_udta_string(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
|
||||
{
|
||||
#ifdef MOV_EXPORT_ALL_METADATA
|
||||
@@ -101,7 +127,7 @@
|
||||
char str[1024], key2[16], language[4] = {0};
|
||||
const char *key = NULL;
|
||||
uint16_t str_size;
|
||||
- int (*parse)(MOVContext*, ByteIOContext*, unsigned) = NULL;
|
||||
+ int (*parse)(MOVContext*, ByteIOContext*, unsigned, const char*) = NULL;
|
||||
|
||||
switch (atom.type) {
|
||||
case MKTAG(0xa9,'n','a','m'): key = "title"; break;
|
||||
@@ -122,6 +148,12 @@
|
||||
case MKTAG( 't','v','s','h'): key = "show"; break;
|
||||
case MKTAG( 't','v','e','n'): key = "episode_id";break;
|
||||
case MKTAG( 't','v','n','n'): key = "network"; break;
|
||||
+ case MKTAG( 't','v','e','s'): key = "episode_sort";
|
||||
+ parse = mov_metadata_int8; break;
|
||||
+ case MKTAG( 't','v','s','n'): key = "season_number";
|
||||
+ parse = mov_metadata_int8; break;
|
||||
+ case MKTAG( 's','t','i','k'): key = "stik";
|
||||
+ parse = mov_metadata_stik; break;
|
||||
case MKTAG( 't','r','k','n'): key = "track";
|
||||
parse = mov_metadata_trkn; break;
|
||||
}
|
||||
@@ -157,10 +189,11 @@
|
||||
str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
|
||||
|
||||
if (parse)
|
||||
- parse(c, pb, str_size);
|
||||
+ parse(c, pb, str_size, key);
|
||||
else {
|
||||
get_buffer(pb, str, str_size);
|
||||
str[str_size] = 0;
|
||||
+
|
||||
av_metadata_set(&c->fc->metadata, key, str);
|
||||
if (*language && strcmp(language, "und")) {
|
||||
snprintf(key2, sizeof(key2), "%s-%s", key, language);
|
@ -1,81 +0,0 @@
|
||||
--- ffmpeg/libavformat/mov.c 2010-12-13 17:10:32.347224001 -0800
|
||||
+++ ffmpeg/libavformat/mov.c 2010-12-13 17:03:05.078969987 -0800
|
||||
@@ -78,19 +78,46 @@
|
||||
|
||||
static const MOVParseTableEntry mov_default_parse_table[];
|
||||
|
||||
-static int mov_metadata_trkn(MOVContext *c, ByteIOContext *pb, unsigned len)
|
||||
+static int mov_metadata_trkn(MOVContext *c, ByteIOContext *pb, unsigned len, const char *key)
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
get_be16(pb); // unknown
|
||||
snprintf(buf, sizeof(buf), "%d", get_be16(pb));
|
||||
- av_metadata_set2(&c->fc->metadata, "track", buf, 0);
|
||||
+ av_metadata_set(&c->fc->metadata, key, buf);
|
||||
|
||||
get_be16(pb); // total tracks
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int mov_metadata_int8(MOVContext *c, ByteIOContext *pb, unsigned len, const char *key)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+
|
||||
+ /* bypass padding bytes */
|
||||
+ get_byte(pb);
|
||||
+ get_byte(pb);
|
||||
+ get_byte(pb);
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf-1), "%hu", get_byte(pb));
|
||||
+ buf[sizeof(buf)-1] = 0;
|
||||
+ av_metadata_set(&c->fc->metadata, key, buf);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mov_metadata_stik(MOVContext *c, ByteIOContext *pb, unsigned len, const char *key)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf-1), "%hu", get_byte(pb));
|
||||
+ buf[sizeof(buf)-1] = 0;
|
||||
+ av_metadata_set(&c->fc->metadata, key, buf);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static const uint32_t mac_to_unicode[128] = {
|
||||
0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
|
||||
0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
|
||||
@@ -137,7 +164,7 @@
|
||||
const char *key = NULL;
|
||||
uint16_t str_size, langcode = 0;
|
||||
uint32_t data_type = 0;
|
||||
- int (*parse)(MOVContext*, ByteIOContext*, unsigned) = NULL;
|
||||
+ int (*parse)(MOVContext*, ByteIOContext*, unsigned, const char *) = NULL;
|
||||
|
||||
switch (atom.type) {
|
||||
case MKTAG(0xa9,'n','a','m'): key = "title"; break;
|
||||
@@ -159,6 +186,11 @@
|
||||
case MKTAG( 't','v','s','h'): key = "show"; break;
|
||||
case MKTAG( 't','v','e','n'): key = "episode_id";break;
|
||||
case MKTAG( 't','v','n','n'): key = "network"; break;
|
||||
+ case MKTAG( 't','v','e','s'): key = "episode_sort";
|
||||
+ case MKTAG( 't','v','s','n'): key = "season_number";
|
||||
+ parse = mov_metadata_int8; break;
|
||||
+ case MKTAG( 's','t','i','k'): key = "stik";
|
||||
+ parse = mov_metadata_stik; break;
|
||||
case MKTAG( 't','r','k','n'): key = "track";
|
||||
parse = mov_metadata_trkn; break;
|
||||
}
|
||||
@@ -195,7 +227,7 @@
|
||||
str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
|
||||
|
||||
if (parse)
|
||||
- parse(c, pb, str_size);
|
||||
+ parse(c, pb, str_size, key);
|
||||
else {
|
||||
if (data_type == 3 || (data_type == 0 && langcode < 0x800)) { // MAC Encoded
|
||||
mov_read_mac_string(c, pb, str_size, str, sizeof(str));
|
@ -1,81 +0,0 @@
|
||||
--- libav/libavformat/mov.c 2011-08-09 14:03:47.622688230 -0700
|
||||
+++ libav/libavformat/mov.c 2011-08-09 14:09:33.181475099 -0700
|
||||
@@ -81,19 +81,46 @@
|
||||
|
||||
static const MOVParseTableEntry mov_default_parse_table[];
|
||||
|
||||
-static int mov_metadata_trkn(MOVContext *c, AVIOContext *pb, unsigned len)
|
||||
+static int mov_metadata_trkn(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
|
||||
{
|
||||
char buf[16];
|
||||
|
||||
avio_rb16(pb); // unknown
|
||||
snprintf(buf, sizeof(buf), "%d", avio_rb16(pb));
|
||||
- av_dict_set(&c->fc->metadata, "track", buf, 0);
|
||||
+ av_dict_set(&c->fc->metadata, key, buf, 0);
|
||||
|
||||
avio_rb16(pb); // total tracks
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int mov_metadata_int8(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+
|
||||
+ /* bypass padding bytes */
|
||||
+ get_byte(pb);
|
||||
+ get_byte(pb);
|
||||
+ get_byte(pb);
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf-1), "%hu", get_byte(pb));
|
||||
+ buf[sizeof(buf)-1] = 0;
|
||||
+ av_metadata_set2(&c->fc->metadata, key, buf, 0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int mov_metadata_stik(MOVContext *c, AVIOContext *pb, unsigned len, const char *key)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+
|
||||
+ snprintf(buf, sizeof(buf-1), "%hu", get_byte(pb));
|
||||
+ buf[sizeof(buf)-1] = 0;
|
||||
+ av_metadata_set2(&c->fc->metadata, key, buf, 0);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static const uint32_t mac_to_unicode[128] = {
|
||||
0x00C4,0x00C5,0x00C7,0x00C9,0x00D1,0x00D6,0x00DC,0x00E1,
|
||||
0x00E0,0x00E2,0x00E4,0x00E3,0x00E5,0x00E7,0x00E9,0x00E8,
|
||||
@@ -140,7 +167,7 @@
|
||||
const char *key = NULL;
|
||||
uint16_t str_size, langcode = 0;
|
||||
uint32_t data_type = 0;
|
||||
- int (*parse)(MOVContext*, AVIOContext*, unsigned) = NULL;
|
||||
+ int (*parse)(MOVContext*, AVIOContext*, unsigned, const char *) = NULL;
|
||||
|
||||
switch (atom.type) {
|
||||
case MKTAG(0xa9,'n','a','m'): key = "title"; break;
|
||||
@@ -162,6 +189,11 @@
|
||||
case MKTAG( 't','v','s','h'): key = "show"; break;
|
||||
case MKTAG( 't','v','e','n'): key = "episode_id";break;
|
||||
case MKTAG( 't','v','n','n'): key = "network"; break;
|
||||
+ case MKTAG( 't','v','e','s'): key = "episode_sort";
|
||||
+ case MKTAG( 't','v','s','n'): key = "season_number";
|
||||
+ parse = mov_metadata_int8; break;
|
||||
+ case MKTAG( 's','t','i','k'): key = "stik";
|
||||
+ parse = mov_metadata_stik; break;
|
||||
case MKTAG( 't','r','k','n'): key = "track";
|
||||
parse = mov_metadata_trkn; break;
|
||||
}
|
||||
@@ -198,7 +230,7 @@
|
||||
str_size = FFMIN3(sizeof(str)-1, str_size, atom.size);
|
||||
|
||||
if (parse)
|
||||
- parse(c, pb, str_size);
|
||||
+ parse(c, pb, str_size, key);
|
||||
else {
|
||||
if (data_type == 3 || (data_type == 0 && langcode < 0x800)) { // MAC Encoded
|
||||
mov_read_mac_string(c, pb, str_size, str, sizeof(str));
|
Loading…
Reference in New Issue
Block a user