* 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.
This commit is contained in:
11
ChangeLog
11
ChangeLog
@@ -1,3 +1,14 @@
|
||||
2011-08-05 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* 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 <thomas at apestaart dot org>
|
||||
|
||||
* morituri/extern/task (added):
|
||||
|
||||
@@ -13,6 +13,4 @@ morituri_PYTHON = \
|
||||
log.py \
|
||||
logcommand.py \
|
||||
program.py \
|
||||
renamer.py \
|
||||
task.py \
|
||||
taskgtk.py
|
||||
renamer.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
|
||||
|
||||
|
||||
47
morituri/common/gstreamer.py
Normal file
47
morituri/common/gstreamer.py
Normal file
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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)
|
||||
8
morituri/extern/Makefile.am
vendored
8
morituri/extern/Makefile.am
vendored
@@ -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
|
||||
|
||||
26
morituri/extern/task/gstreamer.py
vendored
26
morituri/extern/task/gstreamer.py
vendored
@@ -20,8 +20,6 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with morituri. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user