changeset 32536:187f26cba0ce

If audio_block_size is 0 that is a bug (and will result in a division by 0 in one case that does not check this), thus remove all checks for it.
author reimar
date Sat, 13 Nov 2010 10:23:34 +0000
parents 6320065226a6
children 8fa2f43cb760
files libmpdemux/demux_avi.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_avi.c	Sat Nov 13 10:17:13 2010 +0000
+++ b/libmpdemux/demux_avi.c	Sat Nov 13 10:23:34 2010 +0000
@@ -159,8 +159,8 @@
           pts=priv->avi_audio_pts; //+priv->pts_correction;
       priv->avi_audio_pts=0;
       // update blockcount:
-      priv->audio_block_no+=priv->audio_block_size ?
-	((len+priv->audio_block_size-1)/priv->audio_block_size) : 1;
+      priv->audio_block_no+=
+	(len+priv->audio_block_size-1)/priv->audio_block_size;
   } else
   if(ds==demux->video){
      // video
@@ -687,8 +687,8 @@
                   break;
                 }
                 ++d_audio->pack_no;
-                priv->audio_block_no+=priv->audio_block_size ?
-		    ((len+priv->audio_block_size-1)/priv->audio_block_size) : 1;
+                priv->audio_block_no+=
+		    (len+priv->audio_block_size-1)/priv->audio_block_size;
                 d_audio->dpos+=len;
             }
           }
@@ -713,12 +713,11 @@
 		  skip_audio_bytes+=len;
 		} else {
 		  ++d_audio->pack_no;
-                  priv->audio_block_no+=priv->audio_block_size ?
-		    ((len+priv->audio_block_size-1)/priv->audio_block_size) : 1;
+                  priv->audio_block_no+=
+		    (len+priv->audio_block_size-1)/priv->audio_block_size;
                   d_audio->dpos+=len;
 		  audio_chunk_pos=i;
 		}
-		if(priv->audio_block_size)
 		    chunks-=(len+priv->audio_block_size-1)/priv->audio_block_size;
             }
           }