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

gkovacs subversion at mplayerhq.hu
Mon Jul 13 00:43:44 CEST 2009


Author: gkovacs
Date: Mon Jul 13 00:43:44 2009
New Revision: 4691

Log:
removed ff_playlist_get_duration

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

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c	Mon Jul 13 00:38:58 2009	(r4690)
+++ concat/libavformat/concatgen.c	Mon Jul 13 00:43:44 2009	(r4691)
@@ -55,7 +55,7 @@ int ff_concatgen_read_packet(AVFormatCon
     // -32 AVERROR_EOF for avi, -51 for ogg
         av_log(ic, AV_LOG_DEBUG, "Switching stream %d to %d\n", stream_index, ctx->pe_curidxs[stream_index]+1);
         for (i = 0; i < ic->nb_streams && i < ctx->pe_curidxs_size; ++i) {
-            ctx->time_offsets[i] += ff_playlist_get_duration(ic, i);
+            ctx->time_offsets[i] += av_rescale_q(ic->streams[i]->duration, ic->streams[i]->time_base, AV_TIME_BASE_Q);
         }
         ++ctx->pe_curidxs[stream_index];
         ff_playlist_populate_context(ctx, s, stream_index);

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Mon Jul 13 00:38:58 2009	(r4690)
+++ concat/libavformat/playlist.c	Mon Jul 13 00:43:44 2009	(r4691)
@@ -171,29 +171,6 @@ int ff_playlist_populate_context(Playlis
     return 0;
 }
 
-// returns duration in seconds * AV_TIME_BASE
-int64_t ff_playlist_get_duration(AVFormatContext *ic, int stream_index)
-{
-// TODO storing previous packet pts/dts is ugly hack
-// ic->stream[]->cur_dts correct
-// ic->strea[]->duration correct
-// pkt->pts incorrect (huge negative)
-// pkt->dts correct, depended on by ffmpeg (need to change)
-// ic->stream[]->pts incorrect (0)
-// ic->start_time always 0
-// changing ic->start_time has no effect
-// ic->duration correct, divide by AV_TIME_BASE to get seconds
-// h264 and mpeg1: pkt->dts values incorrect
-    int64_t durn;
-
-//    durn = ic->duration;
-    durn = av_rescale_q(ic->streams[stream_index]->duration, ic->streams[stream_index]->time_base, AV_TIME_BASE_Q);
-
-//    durn = ic->streams[stream_index]->duration; // ogg gives wrong value
-    printf("duration is %ld\n", durn);
-    return durn;
-}
-
 void ff_playlist_relative_paths(char **flist, const char *workingdir)
 {
     while (*flist != 0) { // determine if relative paths

Modified: concat/libavformat/playlist.h
==============================================================================
--- concat/libavformat/playlist.h	Mon Jul 13 00:38:58 2009	(r4690)
+++ concat/libavformat/playlist.h	Mon Jul 13 00:43:44 2009	(r4691)
@@ -59,8 +59,6 @@ int ff_playlist_populate_context(Playlis
 
 void ff_split_wd_fn(const char *filepath, char **workingdir, char **filename);
 
-int64_t ff_playlist_get_duration(AVFormatContext *ic, int stream_index);
-
 void ff_playlist_relative_paths(char **flist, const char *workingdir);
 
 PlaylistContext* ff_playlist_get_context(AVFormatContext *ic);


More information about the FFmpeg-soc mailing list