[FFmpeg-soc] [soc]: r4397 - seek_api/mpeg.c

spyfeng subversion at mplayerhq.hu
Mon Jun 8 18:59:30 CEST 2009


Author: spyfeng
Date: Mon Jun  8 18:59:30 2009
New Revision: 4397

Log:
remove useless function

Modified:
   seek_api/mpeg.c

Modified: seek_api/mpeg.c
==============================================================================
--- seek_api/mpeg.c	Mon Jun  8 18:40:03 2009	(r4396)
+++ seek_api/mpeg.c	Mon Jun  8 18:59:30 2009	(r4397)
@@ -707,81 +707,6 @@ success:
     return 0;
 }
 
-static int mpegps_read_seek(struct AVFormatContext *s, int stream_index,
-                            int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
-{
-    AVStream *st;
-    int index;
-    AVPacket pkt1, *pkt = &pkt1;
-    int64_t pos, pts, ret_ts, av_uninit(pos_min), av_uninit(pos_max), pos_limit = -1;
-    flags = flags | (ts - min_ts > (uint64_t)(max_ts - ts) ? AVSEEK_FLAG_BACKWARD : 0);
-
-    if (stream_index < 0){
-        stream_index= av_find_default_stream_index(s);
-        if(stream_index < 0)
-            return -1;
-        st = s->streams[stream_index];
-        ts = av_rescale(ts, st->time_base.den, AV_TIME_BASE * (int64_t)st->time_base.num);
-    } else {
-        st = s->streams[stream_index];
-    }
-
-    if (st->discard >= AVDISCARD_ALL) {
-        av_log(s, AV_LOG_ERROR, "Not active stream!\n");
-        return -1;
-    }
-
-    min_ts =
-    max_ts = AV_NOPTS_VALUE;
-
-    if (st->index_entries) {
-        AVIndexEntry *e;
-
-        index = av_index_search_timestamp(st, ts, flags | AVSEEK_FLAG_BACKWARD);
-        index = FFMAX(index, 0);
-        e= &st->index_entries[index];
-
-        if (e->timestamp <= ts || e->pos == e->min_distance) {
-            pos_min = e->pos;
-            min_ts = e->timestamp;
-        }
-
-        index = av_index_search_timestamp(st, ts, flags & ~AVSEEK_FLAG_BACKWARD);
-        if (index >= 0) {
-            pos_max = st->index_entries[index].pos;
-            max_ts = st->index_entries[index].timestamp;
-            pos_limit = pos_max - st->index_entries[index].min_distance;
-        }
-    }
-    av_log(s, AV_LOG_DEBUG, "pos_min=0x%"PRIx64" pos_max=0x%"PRIx64" pos_limit=0x%"PRIx64" max_ts=%"PRId64" min_ts=%"PRId64" ts=%"PRId64"\n",
-           pos_min, pos_max, pos_limit, max_ts, min_ts, ts);
-    pos= av_gen_search(s, stream_index, ts, pos_min, pos_max, pos_limit,
-                                        min_ts, max_ts, flags, &ret_ts, mpegps_read_dts);
-    if (pos < 0)
-        return -1;
-    url_fseek(s->pb, pos, SEEK_SET);
-    av_log(s, AV_LOG_DEBUG, "the seek pos = %"PRId64"\n", pos);
-
-    if (ts >= ret_ts) {
-        // find the keyframe
-        for (;;) {
-            if (av_read_frame(s, pkt) < 0){
-                av_log(s, AV_LOG_ERROR, "can not find the key frame\n");
-                return -1;
-            }
-            av_free_packet(pkt);
-            if(pkt->flags&PKT_FLAG_KEY){
-                pos = pkt->pos;
-                pts= pkt->pts;
-                av_log(s, AV_LOG_DEBUG, "keyframe pos = %"PRId64" pts = %"PRId64"\n", pos, pts);
-                break;
-            }
-        }
-    }
-    av_update_cur_dts(s, st, ret_ts);
-    return 0;
-}
-
 AVInputFormat mpegps_demuxer = {
     "mpeg",
     NULL_IF_CONFIG_SMALL("MPEG-PS format"),


More information about the FFmpeg-soc mailing list