public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in media-sound/cmus/files: cmus-2.4.2-ffmpeg.patch
@ 2011-09-30  8:04 Tim Harder (radhermit)
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Harder (radhermit) @ 2011-09-30  8:04 UTC (permalink / raw
  To: gentoo-commits

radhermit    11/09/30 08:04:32

  Added:                cmus-2.4.2-ffmpeg.patch
  Log:
  Version bump (bug #378445).
  
  (Portage version: 2.2.0_alpha60/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch?rev=1.1&content-type=text/plain

Index: cmus-2.4.2-ffmpeg.patch
===================================================================
--- cmus-v2.4.2/ffmpeg.c.orig
+++ cmus-v2.4.2/ffmpeg.c
@@ -21,6 +21,7 @@
 #include "xmalloc.h"
 #include "debug.h"
 #include "utils.h"
+#include "comment.h"
 #include "config/ffmpeg.h"
 
 #include <stdio.h>
@@ -32,6 +33,9 @@
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
 #include <libavformat/avio.h>
+#ifndef AVUTIL_MATHEMATICS_H
+#include <libavutil/mathematics.h>
+#endif
 #endif
 
 #if (LIBAVFORMAT_VERSION_INT < ((52<<16)+(31<<8)+0))
@@ -52,10 +56,19 @@
 #endif
 #endif
 
+#if (LIBAVUTIL_VERSION_INT < ((51<<16)+(5<<8)+0))
+#define AV_DICT_IGNORE_SUFFIX AV_METADATA_IGNORE_SUFFIX
+#define av_dict_get av_metadata_get
+#define AVDictionaryEntry AVMetadataTag
+#endif
+
 struct ffmpeg_input {
 	AVPacket pkt;
 	int curr_pkt_size;
 	uint8_t *curr_pkt_buf;
+
+	unsigned long curr_size;
+	unsigned long curr_duration;
 };
 
 struct ffmpeg_output {
@@ -166,18 +179,26 @@
 	int stream_index = -1;
 	AVCodec *codec;
 	AVCodecContext *cc = NULL;
-	AVFormatContext *ic;
+	AVFormatContext *ic = NULL;
 
 	ffmpeg_init();
 
+#if (LIBAVFORMAT_VERSION_INT < ((53<<16)+(2<<8)+0))
 	err = av_open_input_file(&ic, ip_data->filename, NULL, 0, NULL);
+#else
+	err = avformat_open_input(&ic, ip_data->filename, NULL, NULL);
+#endif
 	if (err < 0) {
 		d_print("av_open failed: %d\n", err);
 		return -IP_ERROR_FILE_FORMAT;
 	}
 
 	do {
+#if (LIBAVFORMAT_VERSION_INT < ((53<<16)+(3<<8)+0))
 		err = av_find_stream_info(ic);
+#else
+		err = avformat_find_stream_info(ic, NULL);
+#endif
 		if (err < 0) {
 			d_print("unable to find stream info: %d\n", err);
 			err = -IP_ERROR_FILE_FORMAT;
@@ -208,7 +229,11 @@
 		if (codec->capabilities & CODEC_CAP_TRUNCATED)
 			cc->flags |= CODEC_FLAG_TRUNCATED;
 
+#if (LIBAVCODEC_VERSION_INT < ((53<<16)+(6<<8)+0))
 		if (avcodec_open(cc, codec) < 0) {
+#else
+		if (avcodec_open2(cc, codec, NULL) < 0) {
+#endif
 			d_print("could not open codec: %d, %s\n", cc->codec_id, cc->codec_name);
 			err = -IP_ERROR_UNSUPPORTED_FILE_TYPE;
 			break;
@@ -299,6 +324,8 @@
 			}
 			input->curr_pkt_size = input->pkt.size;
 			input->curr_pkt_buf = input->pkt.data;
+			input->curr_size += input->pkt.size;
+			input->curr_duration += input->pkt.duration;
 			continue;
 		}
 
@@ -409,7 +436,7 @@
 	char buff[16];
 	int i = 0;
 
-	*comments = xnew0(struct keyval, NUM_FFMPEG_KEYS + 1);
+	*comments = keyvals_new(NUM_FFMPEG_KEYS);
 
 	i = set_comment(*comments, i, "artist", ic->author);
 	i = set_comment(*comments, i, "album", ic->album);
@@ -427,9 +454,9 @@
 	}
 #else
 	GROWING_KEYVALS(c);
-	AVMetadataTag *tag = NULL;
+	AVDictionaryEntry *tag = NULL;
  
-	while ((tag = av_metadata_get(ic->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
+	while ((tag = av_dict_get(ic->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
 		if (tag && tag->value[0])
 			comments_add_const(&c, tag->key, tag->value);
 	}
@@ -472,15 +499,15 @@
 };
 
 const int ip_priority = 30;
-#ifdef USE_FALLBACK_IP
-const char *const ip_extensions[] = { "any", NULL };
-#else
 const char *const ip_extensions[] = {
 	"ac3", "aif", "aifc", "aiff", "ape", "au", "mka", "shn", "tta", "wma",
 	/* also supported by other plugins */
 	"aac", "fla", "flac", "m4a", "m4b", "mp+", "mp2", "mp3", "mp4", "mpc",
 	"mpp", "ogg", "wav", "wv",
+#ifdef USE_FALLBACK_IP
+	"*",
+#endif
 	NULL
 };
-#endif
 const char *const ip_mime_types[] = { NULL };
+const char * const ip_options[] = { NULL };






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in media-sound/cmus/files: cmus-2.4.2-ffmpeg.patch
@ 2011-10-19 19:23 Tim Harder (radhermit)
  0 siblings, 0 replies; 3+ messages in thread
From: Tim Harder (radhermit) @ 2011-10-19 19:23 UTC (permalink / raw
  To: gentoo-commits

radhermit    11/10/19 19:23:19

  Modified:             cmus-2.4.2-ffmpeg.patch
  Log:
  Simplify ffmpeg patch (fixes bug #387017).
  
  (Portage version: 2.2.0_alpha65/cvs/Linux x86_64)

Revision  Changes    Path
1.2                  media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch?r1=1.1&r2=1.2

Index: cmus-2.4.2-ffmpeg.patch
===================================================================
RCS file: /var/cvsroot/gentoo-x86/media-sound/cmus/files/cmus-2.4.2-ffmpeg.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cmus-2.4.2-ffmpeg.patch	30 Sep 2011 08:04:32 -0000	1.1
+++ cmus-2.4.2-ffmpeg.patch	19 Oct 2011 19:23:19 -0000	1.2
@@ -1,14 +1,6 @@
 --- cmus-v2.4.2/ffmpeg.c.orig
 +++ cmus-v2.4.2/ffmpeg.c
-@@ -21,6 +21,7 @@
- #include "xmalloc.h"
- #include "debug.h"
- #include "utils.h"
-+#include "comment.h"
- #include "config/ffmpeg.h"
- 
- #include <stdio.h>
-@@ -32,6 +33,9 @@
+@@ -32,6 +32,9 @@
  #include <libavcodec/avcodec.h>
  #include <libavformat/avformat.h>
  #include <libavformat/avio.h>
@@ -18,113 +10,3 @@
  #endif
  
  #if (LIBAVFORMAT_VERSION_INT < ((52<<16)+(31<<8)+0))
-@@ -52,10 +56,19 @@
- #endif
- #endif
- 
-+#if (LIBAVUTIL_VERSION_INT < ((51<<16)+(5<<8)+0))
-+#define AV_DICT_IGNORE_SUFFIX AV_METADATA_IGNORE_SUFFIX
-+#define av_dict_get av_metadata_get
-+#define AVDictionaryEntry AVMetadataTag
-+#endif
-+
- struct ffmpeg_input {
- 	AVPacket pkt;
- 	int curr_pkt_size;
- 	uint8_t *curr_pkt_buf;
-+
-+	unsigned long curr_size;
-+	unsigned long curr_duration;
- };
- 
- struct ffmpeg_output {
-@@ -166,18 +179,26 @@
- 	int stream_index = -1;
- 	AVCodec *codec;
- 	AVCodecContext *cc = NULL;
--	AVFormatContext *ic;
-+	AVFormatContext *ic = NULL;
- 
- 	ffmpeg_init();
- 
-+#if (LIBAVFORMAT_VERSION_INT < ((53<<16)+(2<<8)+0))
- 	err = av_open_input_file(&ic, ip_data->filename, NULL, 0, NULL);
-+#else
-+	err = avformat_open_input(&ic, ip_data->filename, NULL, NULL);
-+#endif
- 	if (err < 0) {
- 		d_print("av_open failed: %d\n", err);
- 		return -IP_ERROR_FILE_FORMAT;
- 	}
- 
- 	do {
-+#if (LIBAVFORMAT_VERSION_INT < ((53<<16)+(3<<8)+0))
- 		err = av_find_stream_info(ic);
-+#else
-+		err = avformat_find_stream_info(ic, NULL);
-+#endif
- 		if (err < 0) {
- 			d_print("unable to find stream info: %d\n", err);
- 			err = -IP_ERROR_FILE_FORMAT;
-@@ -208,7 +229,11 @@
- 		if (codec->capabilities & CODEC_CAP_TRUNCATED)
- 			cc->flags |= CODEC_FLAG_TRUNCATED;
- 
-+#if (LIBAVCODEC_VERSION_INT < ((53<<16)+(6<<8)+0))
- 		if (avcodec_open(cc, codec) < 0) {
-+#else
-+		if (avcodec_open2(cc, codec, NULL) < 0) {
-+#endif
- 			d_print("could not open codec: %d, %s\n", cc->codec_id, cc->codec_name);
- 			err = -IP_ERROR_UNSUPPORTED_FILE_TYPE;
- 			break;
-@@ -299,6 +324,8 @@
- 			}
- 			input->curr_pkt_size = input->pkt.size;
- 			input->curr_pkt_buf = input->pkt.data;
-+			input->curr_size += input->pkt.size;
-+			input->curr_duration += input->pkt.duration;
- 			continue;
- 		}
- 
-@@ -409,7 +436,7 @@
- 	char buff[16];
- 	int i = 0;
- 
--	*comments = xnew0(struct keyval, NUM_FFMPEG_KEYS + 1);
-+	*comments = keyvals_new(NUM_FFMPEG_KEYS);
- 
- 	i = set_comment(*comments, i, "artist", ic->author);
- 	i = set_comment(*comments, i, "album", ic->album);
-@@ -427,9 +454,9 @@
- 	}
- #else
- 	GROWING_KEYVALS(c);
--	AVMetadataTag *tag = NULL;
-+	AVDictionaryEntry *tag = NULL;
-  
--	while ((tag = av_metadata_get(ic->metadata, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
-+	while ((tag = av_dict_get(ic->metadata, "", tag, AV_DICT_IGNORE_SUFFIX))) {
- 		if (tag && tag->value[0])
- 			comments_add_const(&c, tag->key, tag->value);
- 	}
-@@ -472,15 +499,15 @@
- };
- 
- const int ip_priority = 30;
--#ifdef USE_FALLBACK_IP
--const char *const ip_extensions[] = { "any", NULL };
--#else
- const char *const ip_extensions[] = {
- 	"ac3", "aif", "aifc", "aiff", "ape", "au", "mka", "shn", "tta", "wma",
- 	/* also supported by other plugins */
- 	"aac", "fla", "flac", "m4a", "m4b", "mp+", "mp2", "mp3", "mp4", "mpc",
- 	"mpp", "ogg", "wav", "wv",
-+#ifdef USE_FALLBACK_IP
-+	"*",
-+#endif
- 	NULL
- };
--#endif
- const char *const ip_mime_types[] = { NULL };
-+const char * const ip_options[] = { NULL };






^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-commits] gentoo-x86 commit in media-sound/cmus/files: cmus-2.4.2-ffmpeg.patch
@ 2012-05-16  8:30 Tomas Chvatal (scarabeus)
  0 siblings, 0 replies; 3+ messages in thread
From: Tomas Chvatal (scarabeus) @ 2012-05-16  8:30 UTC (permalink / raw
  To: gentoo-commits

scarabeus    12/05/16 08:30:50

  Removed:              cmus-2.4.2-ffmpeg.patch
  Log:
  Stable on amd64 and x86. Depend on new ffmpeg as it uses new api.
  
  (Portage version: 2.2.0_alpha105/cvs/Linux x86_64)



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-16  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 19:23 [gentoo-commits] gentoo-x86 commit in media-sound/cmus/files: cmus-2.4.2-ffmpeg.patch Tim Harder (radhermit)
  -- strict thread matches above, loose matches on Subject: below --
2012-05-16  8:30 Tomas Chvatal (scarabeus)
2011-09-30  8:04 Tim Harder (radhermit)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox