[FFmpeg-soc] [soc]: r5291 - in concat/libavformat: avplaylist.c avplaylist.h concatgen.c playlist.c playlist.h

gkovacs subversion at mplayerhq.hu
Wed Aug 26 08:04:23 CEST 2009


Author: gkovacs
Date: Wed Aug 26 08:04:23 2009
New Revision: 5291

Log:
move stream_index_from_time out of public header

Modified:
   concat/libavformat/avplaylist.c
   concat/libavformat/avplaylist.h
   concat/libavformat/concatgen.c
   concat/libavformat/playlist.c
   concat/libavformat/playlist.h

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c	Wed Aug 26 08:00:40 2009	(r5290)
+++ concat/libavformat/avplaylist.c	Wed Aug 26 08:04:23 2009	(r5291)
@@ -157,22 +157,6 @@ void av_playlist_relative_paths(char **f
     }
 }
 
-int av_playlist_stream_index_from_time(AVPlaylistContext *ctx,
-                                       int64_t pts,
-                                       int64_t *localpts)
-{
-    int64_t total = 0;
-    int i = ctx->pe_curidx;
-    while (pts >= total) {
-        if (i >= ctx->pelist_size)
-            break;
-        total = ctx->durations[i++];
-    }
-    if (localpts)
-        *localpts = pts-(total-ctx->durations[i-1]);
-    return i;
-}
-
 int av_playlist_localstidx_from_streamidx(AVPlaylistContext *ctx, int stream_index)
 {
     unsigned int i, cur, prev;

Modified: concat/libavformat/avplaylist.h
==============================================================================
--- concat/libavformat/avplaylist.h	Wed Aug 26 08:00:40 2009	(r5290)
+++ concat/libavformat/avplaylist.h	Wed Aug 26 08:04:23 2009	(r5291)
@@ -85,16 +85,6 @@ int av_playlist_add_filelist(AVPlaylistC
  */
 int av_playlist_add_path(AVPlaylistContext *ctx, const char *itempath);
 
-/** @brief Calculates the index of the playlist item which would contain the timestamp specified in AV_TIME_BASE units.
- *  @param ctx AVPlaylistContext within which the list of playlist elements and durations are stored.
- *  @param pts Timestamp in AV_TIME_BASE.
- *  @param localpts Time in the local demuxer's timeframe in AV_TIME_BASE units; if null, not calculated.
- *  @return Returns the index of the stream which covers the specified time range.
- */
-int av_playlist_stream_index_from_time(AVPlaylistContext *ctx,
-                                       int64_t pts,
-                                       int64_t *localpts);
-
 /** @brief Calculates the local stream index which corresponds to a global stream index.
  *  @param ctx AVPlaylistContext within which the list of playlist elements and durations are stored.
  *  @param stream_index Global stream index, the index of the stream within the playlist demuxer.

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c	Wed Aug 26 08:00:40 2009	(r5290)
+++ concat/libavformat/concatgen.c	Wed Aug 26 08:04:23 2009	(r5291)
@@ -118,7 +118,7 @@ int ff_concatgen_read_seek(AVFormatConte
     pts_avtimebase = av_rescale_q(pts,
                                   ic->streams[stream_index]->time_base,
                                   AV_TIME_BASE_Q);
-    ctx->pe_curidx = av_playlist_stream_index_from_time(ctx,
+    ctx->pe_curidx = ff_playlist_stream_index_from_time(ctx,
                                                         pts_avtimebase,
                                                         &localpts_avtimebase);
     err = ff_playlist_populate_context(ctx, ctx->pe_curidx);

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Wed Aug 26 08:00:40 2009	(r5290)
+++ concat/libavformat/playlist.c	Wed Aug 26 08:04:23 2009	(r5291)
@@ -134,3 +134,19 @@ int ff_playlist_set_streams(AVPlaylistCo
         s->iformat->read_timestamp = NULL;
     return 0;
 }
+
+int ff_playlist_stream_index_from_time(AVPlaylistContext *ctx,
+                                       int64_t pts,
+                                       int64_t *localpts)
+{
+    int64_t total = 0;
+    int i = ctx->pe_curidx;
+    while (pts >= total) {
+        if (i >= ctx->pelist_size)
+            break;
+        total = ctx->durations[i++];
+    }
+    if (localpts)
+        *localpts = pts-(total-ctx->durations[i-1]);
+    return i;
+}

Modified: concat/libavformat/playlist.h
==============================================================================
--- concat/libavformat/playlist.h	Wed Aug 26 08:00:40 2009	(r5290)
+++ concat/libavformat/playlist.h	Wed Aug 26 08:04:23 2009	(r5291)
@@ -58,5 +58,15 @@ int ff_playlist_populate_context(AVPlayl
  */
 int ff_playlist_set_streams(AVPlaylistContext *ctx);
 
+/** @brief Calculates the index of the playlist item which would contain the timestamp specified in AV_TIME_BASE units.
+ *  @param ctx AVPlaylistContext within which the list of playlist elements and durations are stored.
+ *  @param pts Timestamp in AV_TIME_BASE.
+ *  @param localpts Time in the local demuxer's timeframe in AV_TIME_BASE units; if null, not calculated.
+ *  @return Returns the index of the stream which covers the specified time range.
+ */
+int ff_playlist_stream_index_from_time(AVPlaylistContext *ctx,
+                                       int64_t pts,
+                                       int64_t *localpts);
+
 #endif /* AVFORMAT_PLAYLIST_H */
 


More information about the FFmpeg-soc mailing list