]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/tta.c
Add FFMPEG_ prefix to all multiple inclusion guards.
[ffmpeg] / libavformat / tta.c
index b4b352269673d1251d75c4530aa6ec838caf9f8f..4b9be6cf30bf22bb5f383060725722980a34d03a 100644 (file)
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 #include "avformat.h"
 #include "bitstream.h"
@@ -71,7 +71,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap)
 
     st = av_new_stream(s, 0);
     if (!st)
-        return AVERROR_NOMEM;
+        return AVERROR(ENOMEM);
 
     av_set_pts_info(st, 64, 1, samplerate);
     st->start_time = 0;
@@ -109,15 +109,17 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
     TTAContext *c = s->priv_data;
     AVStream *st = s->streams[0];
-    int size;
+    int size, ret;
 
     // FIXME!
     if (c->currentframe > c->totalframes)
         return -1;
 
-    size = st->index_entries[c->currentframe++].size;
+    size = st->index_entries[c->currentframe].size;
 
-    return av_get_packet(&s->pb, pkt, size);
+    ret = av_get_packet(&s->pb, pkt, size);
+    pkt->dts = st->index_entries[c->currentframe++].timestamp;
+    return ret;
 }
 
 static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)