[SCM] mediatomb/master: Add Ubuntu's bitrate and audio channels ffmpeg parsing fix.
micove-guest at users.alioth.debian.org
micove-guest at users.alioth.debian.org
Sun Mar 25 15:43:39 UTC 2012
The following commit has been merged in the master branch:
commit 57101a32fde79dcf7cd88cc33afd401e695da78c
Author: Miguel Colon <debian.micove at gmail.com>
Date: Sun Mar 25 11:22:48 2012 -0400
Add Ubuntu's bitrate and audio channels ffmpeg parsing fix.
diff --git a/debian/patches/fix-ffmpeg-metadata.patch b/debian/patches/fix-ffmpeg-metadata.patch
new file mode 100644
index 0000000..95cc15e
--- /dev/null
+++ b/debian/patches/fix-ffmpeg-metadata.patch
@@ -0,0 +1,69 @@
+Description: properly parse the bitrate in bytes/second and the number of
+ audio channels (not audio streams)
+Author: Marc Deslauriers <marc.deslauriers at canonical.com>
+Forwarded: yes, http://sourceforge.net/support/tracker.php?aid=3424145
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mediatomb/+bug/875098
+
+Index: mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc
+===================================================================
+--- mediatomb-0.12.1.orig/src/metadata/ffmpeg_handler.cc 2011-10-16 18:10:28.000000000 -0400
++++ mediatomb-0.12.1/src/metadata/ffmpeg_handler.cc 2011-10-16 18:13:22.488137464 -0400
+@@ -195,9 +195,11 @@
+ // bitrate
+ if (pFormatCtx->bit_rate > 0)
+ {
++ // ffmpeg's bit_rate is in bits/sec, upnp wants it in bytes/sec
++ // See http://www.upnp.org/schemas/av/didl-lite-v3.xsd
+ log_debug("Added overall bitrate: %d kb/s\n",
+- pFormatCtx->bit_rate/1000);
+- item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from(pFormatCtx->bit_rate/1000));
++ pFormatCtx->bit_rate/8);
++ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_BITRATE), String::from(pFormatCtx->bit_rate/8));
+ }
+
+ // video resolution, audio sampling rate, nr of audio channels
+@@ -236,30 +238,27 @@
+ *x = st->codec->width;
+ *y = st->codec->height;
+ }
+- }
+- if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
++ }
++ if((st != NULL) && (audioset == false) && (st->codec->codec_type == AVMEDIA_TYPE_AUDIO))
+ {
+- // Increase number of audiochannels
+- audioch++;
+- // Get the sample rate
+- if ((audioset == false) && (st->codec->sample_rate > 0))
++ // find the first stream that has a valid sample rate
++ if (st->codec->sample_rate > 0)
+ {
+ samplefreq = st->codec->sample_rate;
+- if (samplefreq > 0)
+- {
+- log_debug("Added sample frequency: %d Hz\n", samplefreq);
+- item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from(samplefreq));
+- audioset = true;
+- }
++ log_debug("Added sample frequency: %d Hz\n", samplefreq);
++ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_SAMPLEFREQUENCY), String::from(samplefreq));
++ audioset = true;
++
++ audioch = st->codec->channels;
++ if (audioch > 0)
++ {
++ log_debug("Added number of audio channels: %d\n", audioch);
++ item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(audioch));
++ }
+ }
+ }
+ }
+
+- if (audioch > 0)
+- {
+- log_debug("Added number of audio channels: %d\n", audioch);
+- item->getResource(0)->addAttribute(MetadataHandler::getResAttrName(R_NRAUDIOCHANNELS), String::from(audioch));
+- }
+ } // addFfmpegResourceFields
+
+ /*double time_to_double(struct timeval time) {
diff --git a/debian/patches/series b/debian/patches/series
index 01d292b..360c6c2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ gcc_4.7_support.patch
buffer_overrun_999hours.patch
js_copyObject.patch
fix_spelling_errors.patch
+fix-ffmpeg-metadata.patch
--
MediaTomb packaging
More information about the pkg-multimedia-commits
mailing list