[FFmpeg-soc] [soc]: r4697 - in concat: ffmpeg.c.diff libavformat/concatgen.c libavformat/m3u.c libavformat/playlist.c libavformat/playlist.h libavformat/pls.c libavformat/xspf.c

gkovacs subversion at mplayerhq.hu
Mon Jul 13 04:16:17 CEST 2009


Author: gkovacs
Date: Mon Jul 13 04:16:17 2009
New Revision: 4697

Log:
removed unnecessary parameter from populate_context, documentation

Modified:
   concat/ffmpeg.c.diff
   concat/libavformat/concatgen.c
   concat/libavformat/m3u.c
   concat/libavformat/playlist.c
   concat/libavformat/playlist.h
   concat/libavformat/pls.c
   concat/libavformat/xspf.c

Modified: concat/ffmpeg.c.diff
==============================================================================
--- concat/ffmpeg.c.diff	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/ffmpeg.c.diff	Mon Jul 13 04:16:17 2009	(r4697)
@@ -1,5 +1,5 @@
 diff --git a/ffmpeg.c b/ffmpeg.c
-index 22bfed8..6f2abb3 100644
+index 22bfed8..097f12b 100644
 --- a/ffmpeg.c
 +++ b/ffmpeg.c
 @@ -70,6 +70,8 @@
@@ -87,7 +87,7 @@ index 22bfed8..6f2abb3 100644
 +            ic = av_malloc(sizeof(*ic));
 +//            ic = avformat_alloc_context();
 +            printf("need to generate playlist ctx\n");
-+            playlist_ctx = ff_playlist_alloc_context(filename);
++            playlist_ctx = ff_playlist_alloc_context();
 +            playlist_ctx->pelist_size = 1;
 +            playlist_ctx->pelist = av_malloc(playlist_ctx->pelist_size * sizeof(*(playlist_ctx->pelist)));
 +            memset(playlist_ctx->pelist, 0, playlist_ctx->pelist_size * sizeof(*(playlist_ctx->pelist)));
@@ -100,7 +100,7 @@ index 22bfed8..6f2abb3 100644
 +            ic->iformat = ff_concat_alloc_demuxer();
 +            ic->priv_data = playlist_ctx;
 +            for (i = 0; i < playlist_ctx->pe_curidxs_size; ++i) {
-+                ff_playlist_populate_context(playlist_ctx, ic, i);
++                ff_playlist_populate_context(ic, i);
 +            }
 +            nb_input_files = 1;
 +            input_files[0] = ic;

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/libavformat/concatgen.c	Mon Jul 13 04:16:17 2009	(r4697)
@@ -58,7 +58,7 @@ int ff_concatgen_read_packet(AVFormatCon
             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);
+        ff_playlist_populate_context(s, stream_index);
         have_switched_streams = 1;
         goto retr;
     } else {

Modified: concat/libavformat/m3u.c
==============================================================================
--- concat/libavformat/m3u.c	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/libavformat/m3u.c	Mon Jul 13 04:16:17 2009	(r4697)
@@ -98,7 +98,7 @@ static int m3u_read_header(AVFormatConte
     m3u_list_files(s->pb, ctx, s->filename);
     s->priv_data = ctx;
     for (i = 0; i < ctx->pe_curidxs_size; ++i) {
-        ff_playlist_populate_context(ctx, s, i);
+        ff_playlist_populate_context(s, i);
     }
     return 0;
 }

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/libavformat/playlist.c	Mon Jul 13 04:16:17 2009	(r4697)
@@ -68,7 +68,7 @@ void ff_playlist_init_playelem(PlayElem 
 
 }
 
-PlaylistContext* ff_playlist_alloc_context()
+PlaylistContext* ff_playlist_alloc_context(void)
 {
     int i;
     PlaylistContext *ctx = av_malloc(sizeof(*ctx));
@@ -82,16 +82,14 @@ PlaylistContext* ff_playlist_alloc_conte
     return ctx;
 }
 
-int ff_playlist_populate_context(PlaylistContext *ctx,
-                                 AVFormatContext *s,
+void ff_playlist_populate_context(AVFormatContext *s,
                                  int stream_index)
 {
     int i;
     AVFormatContext *ic;
-    AVFormatParameters *nap;
+    PlaylistContext *ctx = s->priv_data;
     ff_playlist_init_playelem(ctx->pelist[ctx->pe_curidxs[stream_index]]);
     ic = ctx->pelist[ctx->pe_curidxs[stream_index]]->ic;
-    nap = ctx->pelist[ctx->pe_curidxs[stream_index]]->ap;
     ic->iformat->read_header(ic, 0);
     s->nb_streams = ic->nb_streams;
     for (i = 0; i < ic->nb_streams; ++i) {
@@ -99,7 +97,6 @@ int ff_playlist_populate_context(Playlis
     }
     s->packet_buffer = ic->packet_buffer;
     s->packet_buffer_end = ic->packet_buffer_end;
-    return 0;
 }
 
 void ff_playlist_relative_paths(char **flist, const char *workingdir)

Modified: concat/libavformat/playlist.h
==============================================================================
--- concat/libavformat/playlist.h	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/libavformat/playlist.h	Mon Jul 13 04:16:17 2009	(r4697)
@@ -52,11 +52,28 @@ typedef struct PlaylistContext {
     int64_t *time_offsets; /**< Time offsets, in 10^-6 seconds, for each multimedia stream */
 } PlaylistContext;
 
+/** @fn void ff_playlist_init_playelem(PlayElem* pe)
+ *  @brief Opens file, codecs, and streams associated with PlayElem.
+ *  @param pe PlayElem to open. It should already be allocated.
+ */
+
 void ff_playlist_init_playelem(PlayElem* pe);
 
-PlaylistContext* ff_playlist_alloc_context();
 
-int ff_playlist_populate_context(PlaylistContext *playlc, AVFormatContext *s, int stream_index);
+/** @fn PlaylistContext* ff_playlist_alloc_context(void)
+ *  @brief Allocates and returns a PlaylistContext.
+ *  @return Allocated PlaylistContext.
+ */
+
+PlaylistContext* ff_playlist_alloc_context(void);
+
+/** @fn void ff_playlist_populate_context(PlaylistContext *playlc, AVFormatContext *s, int stream_index)
+ *  @brief Opens the current PlayElem from the PlaylistContext.
+ *  @param s AVFormatContext of the master demuxer, which contains the PlaylistContext.
+ *  @param stream_index Index of multimedia stream (video, audio, or subtitle).
+ */
+
+void ff_playlist_populate_context(AVFormatContext *s, int stream_index);
 
 PlaylistContext* ff_playlist_get_context(AVFormatContext *ic);
 

Modified: concat/libavformat/pls.c
==============================================================================
--- concat/libavformat/pls.c	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/libavformat/pls.c	Mon Jul 13 04:16:17 2009	(r4697)
@@ -124,7 +124,7 @@ static int pls_read_header(AVFormatConte
     }
     s->priv_data = ctx;
     for (i = 0; i < ctx->pe_curidxs_size; ++i) {
-        ff_playlist_populate_context(ctx, s, i);
+        ff_playlist_populate_context(s, i);
     }
     return 0;
 }

Modified: concat/libavformat/xspf.c
==============================================================================
--- concat/libavformat/xspf.c	Mon Jul 13 02:22:59 2009	(r4696)
+++ concat/libavformat/xspf.c	Mon Jul 13 04:16:17 2009	(r4697)
@@ -128,7 +128,7 @@ static int xspf_read_header(AVFormatCont
     }
     s->priv_data = ctx;
     for (i = 0; i < ctx->pe_curidxs_size; ++i) {
-        ff_playlist_populate_context(ctx, s, i);
+        ff_playlist_populate_context(s, i);
     }
     return 0;
 }


More information about the FFmpeg-soc mailing list