[FFmpeg-soc] [soc]: r4442 - in concat/libavformat: m3u.c playlist.c playlist.h

gkovacs subversion at mplayerhq.hu
Sat Jun 13 05:50:26 CEST 2009


Author: gkovacs
Date: Sat Jun 13 05:50:26 2009
New Revision: 4442

Log:
switched to ff_ prefixes for general playlist-wide functions

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

Modified: concat/libavformat/m3u.c
==============================================================================
--- concat/libavformat/m3u.c	Sat Jun 13 05:33:29 2009	(r4441)
+++ concat/libavformat/m3u.c	Sat Jun 13 05:50:26 2009	(r4442)
@@ -34,7 +34,7 @@ static const AVCodecTag codec_m3u_tags[]
 static int m3u_probe(AVProbeData *p)
 {
     if (p->buf != 0) {
-        if (compare_bufs(p->buf, "#EXTM3U"))
+        if (!strncmp(p->buf, "#EXTM3U", 7))
             return AVPROBE_SCORE_MAX;
         else
             return 0;
@@ -56,7 +56,7 @@ static int m3u_list_files(ByteIOContext 
     i = 0;
     ofl = av_malloc(sizeof(char*) * bufsize);
     while (1) {
-        char *c = buf_getline(s);
+        char *c = ff_buf_getline(s);
         if (c == NULL) // EOF
             break;
         if (*c == 0) // hashed out
@@ -72,7 +72,7 @@ static int m3u_list_files(ByteIOContext 
     ofl[i] = 0;
     while (*ofl != 0) { // determine if relative paths
         FILE *file;
-        char *fullfpath = conc_strings(workingdir, *ofl);
+        char *fullfpath = ff_conc_strings(workingdir, *ofl);
         file = fopen(fullfpath, "r");
         if (file) {
             fclose(file);
@@ -88,7 +88,7 @@ static int m3u_read_header(AVFormatConte
 {
     printf("m3u read header called\n");
     PlaylistD *playld = av_malloc(sizeof(PlaylistD));
-    split_wd_fn(s->filename,
+    ff_split_wd_fn(s->filename,
                 &playld->workingdir,
                 &playld->filename);
     m3u_list_files(s->pb,
@@ -100,7 +100,7 @@ static int m3u_read_header(AVFormatConte
     memset(playld->pelist, 0, playld->pelist_size * sizeof(PlayElem*));
     playld->pe_curidx = 0;
     s->priv_data = playld;
-    playlist_populate_context(playld, s);
+    ff_playlist_populate_context(playld, s);
     return 0;
 }
 
@@ -124,7 +124,7 @@ static int m3u_read_packet(AVFormatConte
         ++playld->pe_curidx;
 //        pkt->destruct(pkt);
         pkt = av_malloc(sizeof(AVPacket));
-        playlist_populate_context(playld, s);
+        ff_playlist_populate_context(playld, s);
         goto retr;
     }
     return ret;

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Sat Jun 13 05:33:29 2009	(r4441)
+++ concat/libavformat/playlist.c	Sat Jun 13 05:50:26 2009	(r4442)
@@ -25,7 +25,7 @@
 #include <time.h>
 
 // based on decode_thread() in ffplay.c
-int av_alloc_playelem(unsigned char *filename,
+int ff_alloc_playelem(unsigned char *filename,
                       PlayElem *pe)
 {
     AVFormatContext *ic;
@@ -45,11 +45,11 @@ int av_alloc_playelem(unsigned char *fil
     return 0;
 }
 
-PlayElem* av_make_playelem(unsigned char *filename)
+PlayElem* ff_make_playelem(unsigned char *filename)
 {
     int err;
     PlayElem *pe = av_malloc(sizeof(PlayElem));
-    err = av_alloc_playelem(filename, pe);
+    err = ff_alloc_playelem(filename, pe);
     if (err < 0)
         print_error("during-av_alloc_playelem", err);
     err = av_open_input_file(&(pe->ic), pe->filename, pe->fmt, pe->buf_size, pe->ap);
@@ -77,7 +77,7 @@ PlayElem* av_make_playelem(unsigned char
     return pe;
 }
 
-PlaylistD* av_make_playlistd(unsigned char **flist,
+PlaylistD* ff_make_playlistd(unsigned char **flist,
                              int flist_len)
 {
     int i;
@@ -89,7 +89,7 @@ PlaylistD* av_make_playlistd(unsigned ch
     return playld;
 }
 
-char* conc_strings(char *string1, char *string2) {
+char* ff_conc_strings(char *string1, char *string2) {
     char *str1;
     char *str2;
     char *str;
@@ -110,7 +110,7 @@ char* conc_strings(char *string1, char *
     return (str-string1)+str1;
 }
 
-char* buf_getline(ByteIOContext *s)
+char* ff_buf_getline(ByteIOContext *s)
 {
     char *q;
     char *oq;
@@ -140,7 +140,7 @@ char* buf_getline(ByteIOContext *s)
     return oq;
 }
 
-void split_wd_fn(char *filepath,
+void ff_split_wd_fn(char *filepath,
                  char **workingdir,
                  char **filename)
 {
@@ -164,7 +164,7 @@ void split_wd_fn(char *filepath,
     (*filename)[cofp-lslash] = 0;
 }
 
-int playlist_populate_context(PlaylistD *playld,
+int ff_playlist_populate_context(PlaylistD *playld,
                               AVFormatContext *s)
 {
     int i;
@@ -172,7 +172,7 @@ int playlist_populate_context(PlaylistD 
     AVFormatContext *ic;
     AVFormatParameters *nap;
     printf("playlist_populate_context called\n");
-    playld->pelist[playld->pe_curidx] = av_make_playelem(playld->flist[playld->pe_curidx]);
+    playld->pelist[playld->pe_curidx] = ff_make_playelem(playld->flist[playld->pe_curidx]);
     ic = playld->pelist[playld->pe_curidx]->ic;
     nap = playld->pelist[playld->pe_curidx]->ap;
     ic->iformat->read_header(ic, 0);
@@ -230,19 +230,7 @@ int playlist_populate_context(PlaylistD 
     return 0;
 }
 
-int compare_bufs(unsigned char *buf,
-                 unsigned char *rbuf)
-{
-    while (*rbuf != 0) {
-        if (*rbuf != *buf)
-            return 0;
-        ++buf;
-        ++rbuf;
-    }
-    return 1;
-}
-
-unsigned int get_stream_offset(AVFormatContext *s)
+unsigned int ff_get_stream_offset(AVFormatContext *s)
 {
     PlaylistD *playld;
     int i;

Modified: concat/libavformat/playlist.h
==============================================================================
--- concat/libavformat/playlist.h	Sat Jun 13 05:33:29 2009	(r4441)
+++ concat/libavformat/playlist.h	Sat Jun 13 05:50:26 2009	(r4442)
@@ -43,20 +43,16 @@ typedef struct PlaylistD {
     char *filename;
 } PlaylistD;
 
-int av_open_input_playelem(PlayElem *pe);
-
-PlayElem* av_make_playelem(unsigned char *filename);
-
-PlaylistD* av_make_playlistd(unsigned char **flist, int flist_len);
+PlayElem* ff_make_playelem(unsigned char *filename);
 
-int compare_bufs(unsigned char *buf, unsigned char *rbuf);
+PlaylistD* ff_make_playlistd(unsigned char **flist, int flist_len);
 
-int playlist_populate_context(PlaylistD *playld, AVFormatContext *s);
+int ff_playlist_populate_context(PlaylistD *playld, AVFormatContext *s);
 
-char* conc_strings(char *string1, char *string2);
+char* ff_conc_strings(char *string1, char *string2);
 
-char* buf_getline(ByteIOContext *s);
+char* ff_buf_getline(ByteIOContext *s);
 
-void split_wd_fn(char *filepath, char **workingdir, char **filename);
+void ff_split_wd_fn(char *filepath, char **workingdir, char **filename);
 
-unsigned int get_stream_offset(AVFormatContext *s);
+unsigned int ff_get_stream_offset(AVFormatContext *s);


More information about the FFmpeg-soc mailing list