按月归档: 4月 2008

Monkeys Audio (APE) for gstreamer 0.10

src:http://www.linuxsir.org/bbs/thread320386.html

内容原文:
可以在rhythmbox和exaile里播放ape文件了。请大家下载测试

我写了一个monkeys audio的gst 0.10的插件,在我这里基本可用了。一年前我跟0.82插件的作者联系过,他比较忙没空移植,我当时写了一个结果总是崩溃,工作上脱不开身就忘记了。最 近想起来仔细阅读了一下gstreamer plugin developer’s guide,参考了flac的代码写了这个 gstmonkeysdec。编译前请安装mac和mac-devel包,在哪装的我也忘了,rpmfind.net找一下吧。

请把代码下载在目录下执行

代码:
$./configure --prefix=/usr
$su -c "make install"

另外需要安装我打过补丁的gstreamer-plugins-base包,补丁也一并奉上。这是因为gstreamer-plugins- good中已经有一个apetag插件,而且在typefind中的优先级极高,会导致rhythmbox等程序优先调用apetag插件匹配 application/x-apetag类型解析apetag,而不是先匹配application/x-ape来调用 gstapemonkeysdec,就放不了歌曲啦。搞笑的是即使调用了它rhythmbox也显示不出ape tag来。。

还存在两个问题:
1、在seeking的时候反应太慢。经过我的测试,每次seeking需要处理两次EVENT_SEEK,每次都要调用libmac里的CIO->Seek,每次Seek耗费cpu 800,000次,折合0.8秒,这样每次seeking需要近两秒的时间,这是libmac的问题,我无法解决了~
2、在rhythmbox里无法显示apetag。我的插件中已经注册了ape的tag并且实现了读取,使用gst-launch播放时可 以显示tag已经正确解析完毕,但是rhythmbox里就不行,可以在以下对比图中看出。还可以看到ogg的tag也显示不了,flac和mp3正常。 不知道rhythmbox是不是有其他的机制没有使用gstreamer的tag接口,谁乐意的话hack一下rhythmbox吧 ^_^

下载地址

http://gforge.oss.org.cn/projects/gstmac/

Read: 1365

[转]如何修复 “Internet Explorer 无法打开 Internet 站点….”

src:http://www.nirmaltv.com/2007/08/08/how-to-fix-internet-explorer-cannot-open-the-internet-site-operation-aborted-error/

How to Fix “Internet Explorer Cannot Open the Internet Site- Operation Aborted” Error

Of late few of my blog readers using Internet explorer pointed out to me that there was some error happening while loading my blog in IE. Around 25% of my readers use Internet Explorer to read my blog. I check my blog frequently in IE and many times I too encountered this error, but initially I thought it was some error in my browser. The error is really frustrating as it shows only in IE and not in Firefox or Opera or any other browser for that matter.

The nature of error is that it shows up when the site is loads completely. This is what you see when the error occurs.

Internet Explorer Error

Once you click OK, the page is replaced with “The Page cannot be Displayed” error. How to fix this error?

A bit of Googling gave me some idea into this error. This error can happen because of many reasons. Microsoft has even a patch for solving this error in IE.

1. This error can happen if Google Map API is present in the code. If you are getting this error because of Google Map API, then the fix for the problem is available here.

2. If you are not using Google API and still getting the error, then it could be because of this reason.

It is not possible append to the BODY element from script that isn’t a direct child to the BODY element

If there are any Javascripts running inside the body tag or inside a table which is directly a child of body, then most of the times this error is bound to happen. The solution is to move the script to the top or bottom of the body tag or even moving it after the body. The script can also be put inside a function and then calling it from window.onload. Another solution to this problem is to add defer=”defer” in the script tag.

I checked my code for scripts which were running inside the body tag and was a direct child to it. Then I moved all my Javascript codes to bottom of the body tag so that it will not interfere while parsing the page. I tested my blog in IE after I made the change and I could see the difference, the error was not happening any more. I checked in different versions of IE to confirm. In case you are using IE and still getting the error on my blog, please do inform me.

Read: 2050

[转]如何正确的理解CSS的float浮动属性?

src:http://www.52css.com/article.asp?id=228

首先我们了解到,CSS网页布局的原理,就是按照HTML代码中对象声明的顺序,以流布局的方式来显示它,而流布局就不得不说到float浮动技术, 在HTML中的所有对象,默认分为两种:块元素(block element)、内联元素(inline element),虽然也存在着可变元素,但只 是随上下文关系确定该元素是块元素或者内联元素。关于块元素和内联元素可以参考这里。

其实CSS的float属性,作用就是改变块元素(block element)对象的默认显示方式。block对象设置了float属性之后,它将不再独自占据一行。可以浮动到左侧或右侧,关于float属性的详细说明可以参考这里。

需要引起你重视的是,float属性不是你所想象的那么简单,不是通过这一篇文字的说明,就能让你完全搞明白它的工作原理的,我们需要在实践中不断的总结经验,应对所出现的问题。我们通过下面的这个小例子,来说明它的基本工作情况。

我们看下面的CSS代码:

div css xhtml xml Example Source Code Example Source Code [www.52css.com]
.left{
        background-color:#cccccc;
        border:2px solid #333333;
        width:200px;
        height:100px;
}
.leftfloat{
        background-color:#cccccc;
        border:2px solid #333333;
        width:200px;
        height:100px;
        float:left;
}
.right{
        background-color:#cccccc;
        border:2px solid #333333;
        height:100px;
}

left和right为不作任何浮动的类。leftfloat向左浮动的类。

我们再看看xhtml代码:

div css xhtml xml Example Source Code Example Source Code [www.52css.com]
<div class="left">div left float:none</div>
<div class="right">div right [www.52css.ocm]</div>
<div class="leftfloat">div left float:left</div>
<div class="right">div right [www.52css.ocm]</div>
<span class="left">span left float:none</span>
<span class="right">span right</span>

我们看运行效果:

div css xhtml xml Source Code to Run Source Code to Run [www.52css.com]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>www.52css.com</title> <style type="text/css"> <!– .left{ background-color:#cccccc; border:2px solid #333333; width:200px; height:100px; } .leftfloat{ background-color:#cccccc; border:2px solid #333333; width:200px; height:100px; float:left; } .right{ background-color:#cccccc; border:2px solid #333333; height:100px; } –> </style> </head> <body> <div class="left">div left float:none</div> <div class="right">div right [www.52css.ocm]</div> <div class="leftfloat">div left float:left</div> <div class="right">div right [www.52css.ocm]</div> <span class="left">span left float:none</span> <span class="right">span right</span> </body> </html>
    [ 可先修改部分代码 再运行查看效果 ]

我们看(1)和(2):容器(1)没有任何浮动,占据了一整行,将(2)挤到了下面一行。而且(2)也占据了一整行的位置。
我们看(3)和(4):容器(3)声明了左浮动,容器(4)浮动到了它的右侧。实现了这两个容器处于同一行的情况。
我们看(5)和(6):容器(5)和(6)是span元素,也就是内联元素(inline element),自然的处于同一行。

Read: 832