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

gkovacs subversion at mplayerhq.hu
Mon Jul 6 20:27:04 CEST 2009


Author: gkovacs
Date: Mon Jul  6 20:27:04 2009
New Revision: 4637

Log:
removed time_offsets_size, fixed a printf

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

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c	Mon Jul  6 20:21:55 2009	(r4636)
+++ concat/libavformat/concatgen.c	Mon Jul  6 20:27:04 2009	(r4637)
@@ -42,7 +42,7 @@ int ff_concatgen_read_packet(AVFormatCon
         if (pkt) {
             int64_t time_offset;
             time_offset = av_rescale_q(ctx->time_offsets[pkt->stream_index], AV_TIME_BASE_Q, ic->streams[stream_index]->time_base);
-            printf("%s conv stream time from %ld to %ld/%ld is %ld\n", ic->iformat->name, ctx->time_offsets[pkt->stream_index], ic->streams[stream_index]->time_base.num, ic->streams[stream_index]->time_base.den, time_offset);
+            printf("%s conv stream time from %ld to %d/%d is %ld\n", ic->iformat->name, ctx->time_offsets[pkt->stream_index], ic->streams[stream_index]->time_base.num, ic->streams[stream_index]->time_base.den, time_offset);
             // TODO changing either dts or pts leads to timing issues on h264
             pkt->dts += time_offset;
             if (!ic->streams[pkt->stream_index]->codec->has_b_frames)
@@ -59,7 +59,7 @@ int ff_concatgen_read_packet(AVFormatCon
 //        playld->dts_offset += ic->streams[0]->cur_dts;
 //        playld->dts_offset += playld->dts_prevpacket;
         printf("switching streams\n");
-        for (i = 0; i < ic->nb_streams && i < ctx->time_offsets_size; ++i) {
+        for (i = 0; i < ic->nb_streams && i < ctx->pe_curidxs_size; ++i) {
             ctx->time_offsets[i] += ff_playlist_get_duration(ic, i);
         }
         ++ctx->pe_curidxs[stream_index];

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Mon Jul  6 20:21:55 2009	(r4636)
+++ concat/libavformat/playlist.c	Mon Jul  6 20:27:04 2009	(r4637)
@@ -61,14 +61,13 @@ PlaylistContext* ff_playlist_make_contex
 {
     int i;
     PlaylistContext *ctx = av_malloc(sizeof(*ctx));
-    ctx->time_offsets_size = 2; // TODO don't assume we have just 2 streams
-    ctx->time_offsets = av_malloc(sizeof(*(ctx->time_offsets)) * ctx->time_offsets_size);
-    for (i = 0; i < ctx->time_offsets_size; ++i)
-        ctx->time_offsets[i] = 0;
     ctx->pe_curidxs_size = 2; // TODO don't assume we have just 2 streams
     ctx->pe_curidxs = av_malloc(sizeof(*(ctx->pe_curidxs)) * ctx->pe_curidxs_size);
     for (i = 0; i < ctx->pe_curidxs_size; ++i)
         ctx->pe_curidxs[i] = 0;
+    ctx->time_offsets = av_malloc(sizeof(*(ctx->time_offsets)) * ctx->pe_curidxs_size);
+    for (i = 0; i < ctx->pe_curidxs_size; ++i)
+        ctx->time_offsets[i] = 0;
     ff_split_wd_fn(filename,
                    &ctx->workingdir,
                    &ctx->filename);

Modified: concat/libavformat/playlist.h
==============================================================================
--- concat/libavformat/playlist.h	Mon Jul  6 20:21:55 2009	(r4636)
+++ concat/libavformat/playlist.h	Mon Jul  6 20:27:04 2009	(r4637)
@@ -49,7 +49,6 @@ typedef struct PlaylistContext {
     char *workingdir; /**< Directory in which the playlist file is stored in */
     char *filename; /**< Filename (not path) of the playlist file */
     int64_t *time_offsets; /**< Time offsets, in 10^-6 seconds, for each multimedia stream */
-    int time_offsets_size; /**< Length of the time_offsets array (number of multimedia streams) currently set to 2 (video and audio) */
 } PlaylistContext;
 
 void ff_playlist_make_playelem(PlayElem* pe);


More information about the FFmpeg-soc mailing list