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

gkovacs subversion at mplayerhq.hu
Wed Aug 26 03:12:58 CEST 2009


Author: gkovacs
Date: Wed Aug 26 03:12:58 2009
New Revision: 5279

Log:
move playlist_alloc_formatcontext out of public header

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

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c	Wed Aug 26 03:08:25 2009	(r5278)
+++ concat/libavformat/avplaylist.c	Wed Aug 26 03:12:58 2009	(r5279)
@@ -37,30 +37,6 @@
 #include "concat.h"
 #include "playlist.h"
 
-AVFormatContext *av_playlist_alloc_formatcontext(char *filename)
-{
-    int err;
-    AVFormatContext *ic = avformat_alloc_context();
-    if (!ic) {
-        av_log(NULL, AV_LOG_ERROR, "unable to allocate AVFormatContext in av_playlist_alloc_formatcontext\n");
-        return NULL;
-    }
-    err = av_open_input_file(&ic, filename, ic->iformat, 0, NULL);
-    if (err < 0) {
-        av_log(ic, AV_LOG_ERROR, "Error during av_open_input_file\n");
-        av_free(ic);
-        return NULL;
-    }
-    err = av_find_stream_info(ic);
-    if (err < 0) {
-        av_log(ic, AV_LOG_ERROR, "Could not find stream info\n");
-        av_close_input_file(ic);
-        av_free(ic);
-        return NULL;
-    }
-    return ic;
-}
-
 AVPlaylistContext *av_playlist_get_context(AVFormatContext *ic)
 {
     if (ic && ic->iformat && ic->iformat->long_name && ic->priv_data &&

Modified: concat/libavformat/avplaylist.h
==============================================================================
--- concat/libavformat/avplaylist.h	Wed Aug 26 03:08:25 2009	(r5278)
+++ concat/libavformat/avplaylist.h	Wed Aug 26 03:12:58 2009	(r5279)
@@ -48,12 +48,6 @@ typedef struct AVPlaylistContext {
     int *nb_streams_list;                 /**< List of the number of streams in each playlist item*/
 } AVPlaylistContext;
 
-/** @brief Allocates AVFormatContext, then opens file, and probes and opens streams.
- *  @param filename Null-terminated string of path to file to open.
- *  @return Returns an allocated AVFormatContext upon success, or NULL upon failure.
- */
-AVFormatContext *av_playlist_alloc_formatcontext(char *filename);
-
 /** @brief Allocates a new AVFormatContext for a concat-type demuxer.
  *  @return Returns NULL if failed, or AVFormatContext if succeeded.
  */

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Wed Aug 26 03:08:25 2009	(r5278)
+++ concat/libavformat/playlist.c	Wed Aug 26 03:12:58 2009	(r5279)
@@ -31,17 +31,41 @@
 #include "playlist.h"
 #include "concatgen.h"
 
+AVFormatContext *ff_playlist_alloc_formatcontext(char *filename)
+{
+    int err;
+    AVFormatContext *ic = avformat_alloc_context();
+    if (!ic) {
+        av_log(NULL, AV_LOG_ERROR, "unable to allocate AVFormatContext in ff_playlist_alloc_formatcontext\n");
+        return NULL;
+    }
+    err = av_open_input_file(&ic, filename, ic->iformat, 0, NULL);
+    if (err < 0) {
+        av_log(ic, AV_LOG_ERROR, "Error during av_open_input_file\n");
+        av_free(ic);
+        return NULL;
+    }
+    err = av_find_stream_info(ic);
+    if (err < 0) {
+        av_log(ic, AV_LOG_ERROR, "Could not find stream info\n");
+        av_close_input_file(ic);
+        av_free(ic);
+        return NULL;
+    }
+    return ic;
+}
+
 int ff_playlist_populate_context(AVPlaylistContext *ctx, int pe_curidx)
 {
     AVFormatContext **formatcontext_list_tmp = av_realloc(ctx->formatcontext_list, sizeof(*(ctx->formatcontext_list)) * (pe_curidx+2));
     if (!formatcontext_list_tmp) {
-        av_log(NULL, AV_LOG_ERROR, "av_realloc error in av_playlist_populate_context\n");
+        av_log(NULL, AV_LOG_ERROR, "av_realloc error in ff_playlist_populate_context\n");
         av_free(ctx->formatcontext_list);
         return AVERROR_NOMEM;
     } else
         ctx->formatcontext_list = formatcontext_list_tmp;
     ctx->formatcontext_list[pe_curidx+1] = NULL;
-    if (!(ctx->formatcontext_list[pe_curidx] = av_playlist_alloc_formatcontext(ctx->flist[pe_curidx])))
+    if (!(ctx->formatcontext_list[pe_curidx] = ff_playlist_alloc_formatcontext(ctx->flist[pe_curidx])))
         return AVERROR_NOFMT;
     ctx->nb_streams_list[pe_curidx] = ctx->formatcontext_list[pe_curidx]->nb_streams;
     if (pe_curidx > 0)

Modified: concat/libavformat/playlist.h
==============================================================================
--- concat/libavformat/playlist.h	Wed Aug 26 03:08:25 2009	(r5278)
+++ concat/libavformat/playlist.h	Wed Aug 26 03:12:58 2009	(r5279)
@@ -33,6 +33,12 @@
 
 #include "avplaylist.h"
 
+/** @brief Allocates AVFormatContext, then opens file, and probes and opens streams.
+ *  @param filename Null-terminated string of path to file to open.
+ *  @return Returns an allocated AVFormatContext upon success, or NULL upon failure.
+ */
+AVFormatContext *ff_playlist_alloc_formatcontext(char *filename);
+
 /** @brief Opens the playlist element with the specified index from the AVPlaylistContext.
  *  @param ctx AVPlaylistContext containing the desired playlist element.
  *  @param pe_curidx Index of the playlist element to be opened.


More information about the FFmpeg-soc mailing list