diff tta.c @ 1969:f7b57a2fa7ca libavformat

argh, who commited this trash start must be 0 ...
author michael
date Fri, 30 Mar 2007 22:10:25 +0000
parents 170e151f1d9e
children 363dcd1e64e0
line wrap: on
line diff
--- a/tta.c	Fri Mar 30 21:59:52 2007 +0000
+++ b/tta.c	Fri Mar 30 22:10:25 2007 +0000
@@ -40,9 +40,7 @@
 {
     TTAContext *c = s->priv_data;
     AVStream *st;
-    int i, channels, bps, samplerate, datalen, framelen, start;
-
-    start = url_ftell(&s->pb);
+    int i, channels, bps, samplerate, datalen, framelen;
 
     if (get_le32(&s->pb) != ff_get_fourcc("TTA1"))
         return -1; // not tta file
@@ -90,14 +88,14 @@
     st->codec->sample_rate = samplerate;
     st->codec->bits_per_sample = bps;
 
-    st->codec->extradata_size = url_ftell(&s->pb) - start;
+    st->codec->extradata_size = url_ftell(&s->pb);
     if(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE <= (unsigned)st->codec->extradata_size){
         //this check is redundant as get_buffer should fail
         av_log(s, AV_LOG_ERROR, "extradata_size too large\n");
         return -1;
     }
     st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
-    url_fseek(&s->pb, start, SEEK_SET); // or SEEK_CUR and -size ? :)
+    url_fseek(&s->pb, 0, SEEK_SET);
     get_buffer(&s->pb, st->codec->extradata, st->codec->extradata_size);
 
     return 0;