[SCM] libav/experimental: Support for seeking in TTA files.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:59:12 UTC 2013


The following commit has been merged in the experimental branch:
commit 70fa2486a151200725489bb89c4f919c0a790420
Author: David Conrad <lessen42 at gmail.com>
Date:   Wed Apr 25 23:22:05 2007 +0000

    Support for seeking in TTA files.
    
    Originally committed as revision 8820 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavformat/tta.c b/libavformat/tta.c
index 3168a07..b4b3522 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -120,6 +120,20 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
     return av_get_packet(&s->pb, pkt, size);
 }
 
+static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
+{
+    TTAContext *c = s->priv_data;
+    AVStream *st = s->streams[stream_index];
+    int index = av_index_search_timestamp(st, timestamp, flags);
+    if (index < 0)
+        return -1;
+
+    c->currentframe = index;
+    url_fseek(&s->pb, st->index_entries[index].pos, SEEK_SET);
+
+    return 0;
+}
+
 AVInputFormat tta_demuxer = {
     "tta",
     "true-audio",
@@ -128,5 +142,6 @@ AVInputFormat tta_demuxer = {
     tta_read_header,
     tta_read_packet,
     NULL,
+    tta_read_seek,
     .extensions = "tta",
 };

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list