diff --git a/ChangeLog b/ChangeLog index 78fee6e..4c57cd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-08-05 Thomas Vander Stichele + + * morituri/common/Makefile.am: + * morituri/common/checksum.py: + * morituri/common/gstreamer.py: + * morituri/extern/Makefile.am: + * morituri/extern/task/gstreamer.py: + * morituri/common/gstreamer.py (added): + Extract function to remove audio parsers. + Fix up dist. + 2011-08-05 Thomas Vander Stichele * morituri/extern/task (added): diff --git a/morituri/common/Makefile.am b/morituri/common/Makefile.am index a9c55c6..ad29478 100644 --- a/morituri/common/Makefile.am +++ b/morituri/common/Makefile.am @@ -13,6 +13,4 @@ morituri_PYTHON = \ log.py \ logcommand.py \ program.py \ - renamer.py \ - task.py \ - taskgtk.py + renamer.py diff --git a/morituri/common/checksum.py b/morituri/common/checksum.py index 7a769d5..3f8a7c4 100644 --- a/morituri/common/checksum.py +++ b/morituri/common/checksum.py @@ -27,6 +27,7 @@ import zlib import gst from morituri.common import common +from morituri.common import gstreamer as cgstreamer from morituri.extern.task import task, gstreamer @@ -74,7 +75,7 @@ class ChecksumTask(gstreamer.GstPipelineTask): self.checksum = None # result - gstreamer.removeAudioParsers() + cgstreamer.removeAudioParsers() ### gstreamer.GstPipelineTask implementations diff --git a/morituri/common/gstreamer.py b/morituri/common/gstreamer.py new file mode 100644 index 0000000..a55e246 --- /dev/null +++ b/morituri/common/gstreamer.py @@ -0,0 +1,47 @@ +# -*- Mode: Python; test-case-name: morituri.test.test_common_gstreamer -*- +# vi:si:et:sw=4:sts=4:ts=4 + +# Morituri - for those about to RIP + +# Copyright (C) 2009 Thomas Vander Stichele + +# This file is part of morituri. +# +# morituri is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# morituri is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with morituri. If not, see . + +from morituri.common import log + +# workaround for issue #64 +def removeAudioParsers(): + log.debug('gstreamer', 'Removing buggy audioparsers plugin if needed') + + import gst + registry = gst.registry_get_default() + + plugin = registry.find_plugin("audioparsersbad") + if plugin: + # always remove from bad + log.debug('gstreamer', 'removing audioparsersbad plugin from registry') + registry.remove_plugin(plugin) + + plugin = registry.find_plugin("audioparsers") + if plugin: + log.debug('gstreamer', 'Found audioparsers plugin from %s %s', + plugin.get_source(), plugin.get_version()) + + if plugin.get_source() == 'gst-plugins-good' \ + and plugin.get_version() > '0.10.29.1': + return + + registry.remove_plugin(plugin) diff --git a/morituri/extern/Makefile.am b/morituri/extern/Makefile.am index 4a3d72e..3122608 100644 --- a/morituri/extern/Makefile.am +++ b/morituri/extern/Makefile.am @@ -18,4 +18,12 @@ command_PYTHON = \ command/__init__.py \ command/command.py +taskdir = $(PYTHONLIBDIR)/morituri/extern/task + +task_PYTHON = \ + task/__init__.py \ + task/task.py \ + task/taskgtk.py \ + task/gstreamer.py + EXTRA_DIST = log/test_log.py command/test_command.py command/help2man.py diff --git a/morituri/extern/task/gstreamer.py b/morituri/extern/task/gstreamer.py index 2ba8631..e0f354a 100644 --- a/morituri/extern/task/gstreamer.py +++ b/morituri/extern/task/gstreamer.py @@ -20,8 +20,6 @@ # You should have received a copy of the GNU General Public License # along with morituri. If not, see . -from morituri.common import log - import task class GstException(Exception): @@ -173,27 +171,3 @@ class GstPipelineTask(task.Task): self.setAndRaiseException(exc) self.debug('error, scheduling stop') self.schedule(0, self.stop) - -# workaround for issue #64 -def removeAudioParsers(): - log.debug('gstreamer', 'Removing buggy audioparsers plugin if needed') - - import gst - registry = gst.registry_get_default() - - plugin = registry.find_plugin("audioparsersbad") - if plugin: - # always remove from bad - log.debug('gstreamer', 'removing audioparsersbad plugin from registry') - registry.remove_plugin(plugin) - - plugin = registry.find_plugin("audioparsers") - if plugin: - log.debug('gstreamer', 'Found audioparsers plugin from %s %s', - plugin.get_source(), plugin.get_version()) - - if plugin.get_source() == 'gst-plugins-good' \ - and plugin.get_version() > '0.10.29.1': - return - - registry.remove_plugin(plugin)