[FFmpeg-soc] [soc]: r5284 - in concat: ffmpeg.c.diff ffplay.c.diff libavformat/avplaylist.c libavformat/avplaylist.h libavformat/utils.c.diff

gkovacs subversion at mplayerhq.hu
Wed Aug 26 03:49:53 CEST 2009


Author: gkovacs
Date: Wed Aug 26 03:49:53 2009
New Revision: 5284

Log:
remove playlist_get_context

Modified:
   concat/ffmpeg.c.diff
   concat/ffplay.c.diff
   concat/libavformat/avplaylist.c
   concat/libavformat/avplaylist.h
   concat/libavformat/utils.c.diff

Modified: concat/ffmpeg.c.diff
==============================================================================
--- concat/ffmpeg.c.diff	Wed Aug 26 03:42:05 2009	(r5283)
+++ concat/ffmpeg.c.diff	Wed Aug 26 03:49:53 2009	(r5284)
@@ -1,5 +1,5 @@
 diff --git a/ffmpeg.c b/ffmpeg.c
-index 2686e1d..18b556b 100644
+index 2686e1d..b2bbcd6 100644
 --- a/ffmpeg.c
 +++ b/ffmpeg.c
 @@ -40,6 +40,7 @@
@@ -20,14 +20,17 @@ index 2686e1d..18b556b 100644
  {
      AVFormatContext *os;
      AVOutputStream *ost;
-@@ -1248,8 +1250,13 @@ static int output_packet(AVInputStream *ist, int ist_index,
+@@ -1248,8 +1250,16 @@ static int output_packet(AVInputStream *ist, int ist_index,
      static unsigned int samples_size= 0;
      AVSubtitle subtitle, *subtitle_to_free;
      int got_subtitle;
 +    int stream_offset = 0;
      AVPacket avpkt;
 -
-+    AVPlaylistContext *pl_ctx = av_playlist_get_context(ic);
++    AVPlaylistContext *pl_ctx = NULL;
++    if (ic && ic->iformat && ic->iformat->long_name && ic->priv_data &&
++        !strncmp(ic->iformat->long_name, "CONCAT", 6))
++        pl_ctx = ic->priv_data;
 +    if (pl_ctx && pkt) {
 +        ist->st = ic->streams[pkt->stream_index];
 +        stream_offset = pkt->stream_index - av_playlist_localstidx_from_streamidx(pl_ctx, pkt->stream_index);
@@ -35,7 +38,7 @@ index 2686e1d..18b556b 100644
      if(ist->next_pts == AV_NOPTS_VALUE)
          ist->next_pts= ist->pts;
  
-@@ -1397,7 +1404,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
+@@ -1397,7 +1407,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
                  int frame_size;
  
                  ost = ost_table[i];
@@ -44,7 +47,7 @@ index 2686e1d..18b556b 100644
                      os = output_files[ost->file_index];
  
                      /* set the input output pts pairs */
-@@ -2149,6 +2156,8 @@ static int av_encode(AVFormatContext **output_files,
+@@ -2149,6 +2159,8 @@ static int av_encode(AVFormatContext **output_files,
          AVPacket pkt;
          double ipts_min;
          double opts_min;
@@ -53,12 +56,15 @@ index 2686e1d..18b556b 100644
  
      redo:
          ipts_min= 1e100;
-@@ -2234,12 +2243,43 @@ static int av_encode(AVFormatContext **output_files,
+@@ -2234,12 +2246,46 @@ static int av_encode(AVFormatContext **output_files,
          if (do_pkt_dump) {
              av_pkt_dump_log(NULL, AV_LOG_DEBUG, &pkt, do_hex_dump);
          }
 +
-+        pl_ctx = av_playlist_get_context(is);
++        pl_ctx = NULL;
++        if (is && is->iformat && is->iformat->long_name && is->priv_data &&
++        !strncmp(is->iformat->long_name, "CONCAT", 6))
++            pl_ctx = is->priv_data;
 +        if (pl_ctx) {
 +            if (pkt.stream_index >= nb_istreams &&
 +                pkt.stream_index < is->nb_streams &&
@@ -98,7 +104,7 @@ index 2686e1d..18b556b 100644
          if (ist->discard)
              goto discard_packet;
  
-@@ -2271,8 +2311,7 @@ static int av_encode(AVFormatContext **output_files,
+@@ -2271,8 +2317,7 @@ static int av_encode(AVFormatContext **output_files,
          }
  
          //fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->index, pkt.size);
@@ -108,7 +114,7 @@ index 2686e1d..18b556b 100644
              if (verbose >= 0)
                  fprintf(stderr, "Error while decoding stream #%d.%d\n",
                          ist->file_index, ist->index);
-@@ -2293,7 +2332,7 @@ static int av_encode(AVFormatContext **output_files,
+@@ -2293,7 +2338,7 @@ static int av_encode(AVFormatContext **output_files,
      for(i=0;i<nb_istreams;i++) {
          ist = ist_table[i];
          if (ist->decoding_needed) {

Modified: concat/ffplay.c.diff
==============================================================================
--- concat/ffplay.c.diff	Wed Aug 26 03:42:05 2009	(r5283)
+++ concat/ffplay.c.diff	Wed Aug 26 03:49:53 2009	(r5284)
@@ -1,5 +1,5 @@
 diff --git a/ffplay.c b/ffplay.c
-index 814efc5..f5766a0 100644
+index 814efc5..999cddc 100644
 --- a/ffplay.c
 +++ b/ffplay.c
 @@ -29,6 +29,8 @@
@@ -11,7 +11,7 @@ index 814efc5..f5766a0 100644
  #include "cmdutils.h"
  
  #include <SDL.h>
-@@ -1318,13 +1320,21 @@ static int video_thread(void *arg)
+@@ -1318,13 +1320,23 @@ static int video_thread(void *arg)
      VideoState *is = arg;
      AVPacket pkt1, *pkt = &pkt1;
      int len1, got_picture;
@@ -19,12 +19,14 @@ index 814efc5..f5766a0 100644
 +    AVFrame *frame;
      double pts;
 -
-+    AVPlaylistContext *pl_ctx;
++    AVPlaylistContext *pl_ctx = NULL;
 +    int st_idx = 0;
 +    char tryswitchalready = 0;
 +    AVStream *prevst = NULL;
 +    frame = avcodec_alloc_frame();
-+    pl_ctx = av_playlist_get_context(is->ic);
++    if (is->ic && is->ic->iformat && is->ic->iformat->long_name && is->ic->priv_data &&
++        !strncmp(is->ic->iformat->long_name, "CONCAT", 6))
++        pl_ctx = is->ic->priv_data;
      for(;;) {
          while (is->paused && !is->videoq.abort_request) {
              SDL_Delay(10);
@@ -35,7 +37,7 @@ index 814efc5..f5766a0 100644
          if (packet_queue_get(&is->videoq, pkt, 1) < 0)
              break;
  
-@@ -1332,13 +1342,34 @@ static int video_thread(void *arg)
+@@ -1332,13 +1344,34 @@ static int video_thread(void *arg)
              avcodec_flush_buffers(is->video_st->codec);
              continue;
          }
@@ -73,7 +75,7 @@ index 814efc5..f5766a0 100644
  
          if(   (decoder_reorder_pts || pkt->dts == AV_NOPTS_VALUE)
             && frame->reordered_opaque != AV_NOPTS_VALUE)
-@@ -1348,9 +1379,6 @@ static int video_thread(void *arg)
+@@ -1348,9 +1381,6 @@ static int video_thread(void *arg)
          else
              pts= 0;
          pts *= av_q2d(is->video_st->time_base);
@@ -83,7 +85,7 @@ index 814efc5..f5766a0 100644
          if (got_picture) {
              if (output_picture2(is, frame, pts) < 0)
                  goto the_end;
-@@ -1543,50 +1571,68 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
+@@ -1543,50 +1573,70 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
  {
      AVPacket *pkt_temp = &is->audio_pkt_temp;
      AVPacket *pkt = &is->audio_pkt;
@@ -92,10 +94,12 @@ index 814efc5..f5766a0 100644
      double pts;
 -
 +    int st_idx = 0;
-+    AVPlaylistContext *pl_ctx;
++    AVPlaylistContext *pl_ctx = NULL;
 +    AVStream *prevst = NULL;
 +    char tryswitchalready = 0;
-+    pl_ctx = av_playlist_get_context(is->ic);
++    if (is->ic && is->ic->iformat && is->ic->iformat->long_name && is->ic->priv_data &&
++        !strncmp(is->ic->iformat->long_name, "CONCAT", 6))
++        pl_ctx = is->ic->priv_data;
      for(;;) {
 -        /* NOTE: the audio packet can contain several frames */
          while (pkt_temp->size > 0) {
@@ -166,7 +170,7 @@ index 814efc5..f5766a0 100644
                      break;
                  }
                  is->audio_buf= is->audio_buf2;
-@@ -1600,9 +1646,9 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
+@@ -1600,9 +1650,9 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
              /* if no pts, then compute it */
              pts = is->audio_clock;
              *pts_ptr = pts;
@@ -178,7 +182,7 @@ index 814efc5..f5766a0 100644
  #if defined(DEBUG_SYNC)
              {
                  static double last_clock;
-@@ -1614,7 +1660,6 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
+@@ -1614,7 +1664,6 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
  #endif
              return data_size;
          }
@@ -186,7 +190,7 @@ index 814efc5..f5766a0 100644
          /* free the current packet */
          if (pkt->data)
              av_free_packet(pkt);
-@@ -1627,7 +1672,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
+@@ -1627,7 +1676,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr)
          if (packet_queue_get(&is->audioq, pkt, 1) < 0)
              return -1;
          if(pkt->data == flush_pkt.data){

Modified: concat/libavformat/avplaylist.c
==============================================================================
--- concat/libavformat/avplaylist.c	Wed Aug 26 03:42:05 2009	(r5283)
+++ concat/libavformat/avplaylist.c	Wed Aug 26 03:49:53 2009	(r5284)
@@ -37,15 +37,6 @@
 #include "concat.h"
 #include "playlist.h"
 
-AVPlaylistContext *av_playlist_get_context(AVFormatContext *ic)
-{
-    if (ic && ic->iformat && ic->iformat->long_name && ic->priv_data &&
-        !strncmp(ic->iformat->long_name, "CONCAT", 6))
-        return ic->priv_data;
-    else
-        return NULL;
-}
-
 int av_playlist_split_encodedstring(const char *s,
                                     const char sep,
                                     char ***flist_ptr,

Modified: concat/libavformat/avplaylist.h
==============================================================================
--- concat/libavformat/avplaylist.h	Wed Aug 26 03:42:05 2009	(r5283)
+++ concat/libavformat/avplaylist.h	Wed Aug 26 03:49:53 2009	(r5284)
@@ -49,12 +49,6 @@ typedef struct AVPlaylistContext {
     AVFormatContext *master_formatcontext; /**< Parent AVFormatContext of which priv_data is this playlist. NULL if playlist is used standalone. */
 } AVPlaylistContext;
 
-/** @brief Returns AVPlaylistContext continaed within a concat-type demuxer.
- *  @param ic AVFormatContext of the concat-type demuxer, which contains the AVPlaylistContext.
- *  @return Returns NULL if failed (not concat-type demuxer or Playlist not yet allocated), or AVPlaylistContext if succeeded.
- */
-AVPlaylistContext* av_playlist_get_context(AVFormatContext *ic);
-
 /** @brief Converts a list of mixed relative or absolute paths into all absolute paths.
  *  @param flist List of null-terminated strings of relative or absolute paths.
  *  @param len Number of paths in flist.

Modified: concat/libavformat/utils.c.diff
==============================================================================
--- concat/libavformat/utils.c.diff	Wed Aug 26 03:42:05 2009	(r5283)
+++ concat/libavformat/utils.c.diff	Wed Aug 26 03:49:53 2009	(r5284)
@@ -1,5 +1,5 @@
 diff --git a/libavformat/utils.c b/libavformat/utils.c
-index 4cec286..67186ac 100644
+index 4cec286..76cd878 100644
 --- a/libavformat/utils.c
 +++ b/libavformat/utils.c
 @@ -27,6 +27,8 @@
@@ -29,7 +29,7 @@ index 4cec286..67186ac 100644
 +    if (flist && flist_len > 1) {
 +        AVFormatContext *ic = ff_playlist_alloc_concat_formatcontext();
 +        if (ic) {
-+            AVPlaylistContext *playlist_ctx = av_playlist_get_context(ic);
++            AVPlaylistContext *playlist_ctx = ic->priv_data;
 +            if (playlist_ctx) {
 +                av_log(ic, AV_LOG_DEBUG, "Generating playlist from %s\n", filename);
 +                av_playlist_add_filelist(playlist_ctx, flist, flist_len);


More information about the FFmpeg-soc mailing list