Merge commit 'f3a6ad22c977c8fea87c4c5e4535061db6324d66'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 5 May 2014 12:44:33 +0000 (14:44 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 5 May 2014 12:44:33 +0000 (14:44 +0200)
* commit 'f3a6ad22c977c8fea87c4c5e4535061db6324d66':
  avconv: rename InputStream.opts to InputStream.decoder_opts

Conflicts:
ffmpeg.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
ffmpeg.c
ffmpeg.h
ffmpeg_opt.c

diff --cc ffmpeg.c
+++ b/ffmpeg.c
@@@ -501,9 -202,7 +501,9 @@@ static void ffmpeg_cleanup(int ret
  
          av_frame_free(&ist->decoded_frame);
          av_frame_free(&ist->filter_frame);
-         av_dict_free(&ist->opts);
+         av_dict_free(&ist->decoder_opts);
 +        avsubtitle_free(&ist->prev_sub.subtitle);
 +        av_frame_free(&ist->sub2video.frame);
          av_freep(&ist->filters);
          av_freep(&ist->hwaccel_device);
  
@@@ -2249,23 -1566,27 +2249,23 @@@ static int init_input_stream(int ist_in
  
          av_opt_set_int(ist->st->codec, "refcounted_frames", 1, 0);
  
-         if (!av_dict_get(ist->opts, "threads", NULL, 0))
-             av_dict_set(&ist->opts, "threads", "auto", 0);
-         if ((ret = avcodec_open2(ist->st->codec, codec, &ist->opts)) < 0) {
+         if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0))
+             av_dict_set(&ist->decoder_opts, "threads", "auto", 0);
+         if ((ret = avcodec_open2(ist->st->codec, codec, &ist->decoder_opts)) < 0) {
 -            char errbuf[128];
              if (ret == AVERROR_EXPERIMENTAL)
                  abort_codec_experimental(codec, 0);
  
              snprintf(error, error_len,
                       "Error while opening decoder for input stream "
                       "#%d:%d : %s",
 -                     ist->file_index, ist->st->index, errbuf);
 +                     ist->file_index, ist->st->index, av_err2str(ret));
              return ret;
          }
-         assert_avoptions(ist->opts);
+         assert_avoptions(ist->decoder_opts);
      }
  
 -    ist->last_dts = ist->st->avg_frame_rate.num ? - ist->st->codec->has_b_frames * AV_TIME_BASE / av_q2d(ist->st->avg_frame_rate) : 0;
 +    ist->next_pts = AV_NOPTS_VALUE;
      ist->next_dts = AV_NOPTS_VALUE;
 -    init_pts_correction(&ist->pts_ctx);
  
      return 0;
  }
diff --cc ffmpeg.h
+++ b/ffmpeg.h
@@@ -245,23 -224,15 +245,23 @@@ typedef struct InputStream 
  
      int64_t       start;     /* time when read started */
      /* predicted dts of the next packet read for this stream or (when there are
 -     * several frames in a packet) of the next frame in current packet */
 +     * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
      int64_t       next_dts;
 -    /* dts of the last packet read for this stream */
 -    int64_t       last_dts;
 -    PtsCorrectionContext pts_ctx;
 +    int64_t       dts;       ///< dts of the last packet read for this stream (in AV_TIME_BASE units)
 +
 +    int64_t       next_pts;  ///< synthetic pts for the next decode frame (in AV_TIME_BASE units)
 +    int64_t       pts;       ///< current pts of the decoded frame  (in AV_TIME_BASE units)
 +    int           wrap_correction_done;
 +
 +    int64_t filter_in_rescale_delta_last;
 +
      double ts_scale;
 +    int saw_first_ts;
      int showed_multi_packet_warning;
-     AVDictionary *opts;
+     AVDictionary *decoder_opts;
      AVRational framerate;               /* framerate forced with -r */
 +    int top_field_first;
 +    int guess_layout_max;
  
      int resample_height;
      int resample_width;
diff --cc ffmpeg_opt.c
@@@ -594,21 -492,10 +594,21 @@@ static void add_input_streams(OptionsCo
          }
  
          ist->dec = choose_decoder(o, ic, st);
-         ist->opts = filter_codec_opts(o->g->codec_opts, ist->st->codec->codec_id, ic, st, ist->dec);
+         ist->decoder_opts = filter_codec_opts(o->g->codec_opts, ist->st->codec->codec_id, ic, st, ist->dec);
  
 +        ist->reinit_filters = -1;
 +        MATCH_PER_STREAM_OPT(reinit_filters, i, ist->reinit_filters, ic, st);
 +
 +        ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
 +
          switch (dec->codec_type) {
          case AVMEDIA_TYPE_VIDEO:
 +            if(!ist->dec)
 +                ist->dec = avcodec_find_decoder(dec->codec_id);
 +            if (av_codec_get_lowres(dec)) {
 +                dec->flags |= CODEC_FLAG_EMU_EDGE;
 +            }
 +
              ist->resample_height  = dec->height;
              ist->resample_width   = dec->width;
              ist->resample_pix_fmt = dec->pix_fmt;