check to see if numframes > 1

git-svn-id: svn://10.0.0.236/trunk@87860 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pavlov%netscape.com
2001-02-24 00:31:08 +00:00
parent f6a36002fc
commit a15ba6d7ac

View File

@@ -100,7 +100,7 @@ nsresult imgRequest::AddObserver(imgIDecoderObserver *observer)
if (mObservers.Count() == 1) {
PRUint32 nframes;
mImage->GetNumFrames(&nframes);
if (nframes > 0) {
if (nframes > 1) {
PR_LOG(gImgLog, PR_LOG_DEBUG,
("[this=%p] imgRequest::AddObserver -- starting animation\n", this));
@@ -121,7 +121,7 @@ nsresult imgRequest::RemoveObserver(imgIDecoderObserver *observer, nsresult stat
if (mImage) {
PRUint32 nframes;
mImage->GetNumFrames(&nframes);
if (nframes > 0) {
if (nframes > 1) {
PR_LOG(gImgLog, PR_LOG_DEBUG,
("[this=%p] imgRequest::RemoveObserver -- stopping animation\n", this));
@@ -164,6 +164,17 @@ NS_IMETHODIMP imgRequest::Cancel(nsresult status)
ImageCache::Remove(mURI);
if (mImage) {
PRUint32 nframes;
mImage->GetNumFrames(&nframes);
if (nframes > 1) {
PR_LOG(gImgLog, PR_LOG_DEBUG,
("[this=%p] imgRequest::RemoveObserver -- stopping animation\n", this));
mImage->StopAnimation();
}
}
if (mChannel && mProcessing)
return mChannel->Cancel(status);