Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 29 Nov 2012 13:22:58 +0000 (14:22 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 29 Nov 2012 13:22:58 +0000 (14:22 +0100)
* qatar/master:
  avplay: Do not use removed av_get_int()
  avconv: fix variable shadowing in configure_input_audio_filter()

Conflicts:
ffmpeg_filter.c
ffplay.c

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

diff --cc ffplay.c
+++ b/ffplay.c
@@@ -87,19 -82,12 +87,19 @@@ const int program_birth_year = 2003
  #define AUDIO_DIFF_AVG_NB   20
  
  /* NOTE: the size must be big enough to compensate the hardware audio buffersize size */
 -#define SAMPLE_ARRAY_SIZE (2 * 65536)
 +/* TODO: We assume that a decoded and resampled frame fits into this buffer */
 +#define SAMPLE_ARRAY_SIZE (8 * 65536)
  
- static int sws_flags = SWS_BICUBIC;
+ static int64_t sws_flags = SWS_BICUBIC;
  
 +typedef struct MyAVPacketList {
 +    AVPacket pkt;
 +    struct MyAVPacketList *next;
 +    int serial;
 +} MyAVPacketList;
 +
  typedef struct PacketQueue {
 -    AVPacketList *first_pkt, *last_pkt;
 +    MyAVPacketList *first_pkt, *last_pkt;
      int nb_packets;
      int size;
      int abort_request;
@@@ -1578,14 -1386,22 +1578,14 @@@ static int queue_picture(VideoState *is
          pict.linesize[2] = vp->bmp->pitches[1];
  
  #if CONFIG_AVFILTER
 -        pict_src.data[0] = src_frame->data[0];
 -        pict_src.data[1] = src_frame->data[1];
 -        pict_src.data[2] = src_frame->data[2];
 -
 -        pict_src.linesize[0] = src_frame->linesize[0];
 -        pict_src.linesize[1] = src_frame->linesize[1];
 -        pict_src.linesize[2] = src_frame->linesize[2];
 -
          // FIXME use direct rendering
 -        av_picture_copy(&pict, &pict_src,
 -                        vp->pix_fmt, vp->width, vp->height);
 +        av_picture_copy(&pict, (AVPicture *)src_frame,
 +                        src_frame->format, vp->width, vp->height);
  #else
-         sws_flags = av_get_int(sws_opts, "sws_flags", NULL);
+         av_opt_get_int(sws_opts, "sws_flags", 0, &sws_flags);
          is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx,
 -            vp->width, vp->height, vp->pix_fmt, vp->width, vp->height,
 -            dst_pix_fmt, sws_flags, NULL, NULL, NULL);
 +            vp->width, vp->height, src_frame->format, vp->width, vp->height,
 +            AV_PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL);
          if (is->img_convert_ctx == NULL) {
              fprintf(stderr, "Cannot initialize the conversion context\n");
              exit(1);
@@@ -1725,21 -1512,17 +1725,21 @@@ static int configure_video_filters(AVFi
      char sws_flags_str[128];
      char buffersrc_args[256];
      int ret;
 -    AVFilterContext *filt_src = NULL, *filt_out = NULL, *filt_format;
 +    AVBufferSinkParams *buffersink_params = av_buffersink_params_alloc();
 +    AVFilterContext *filt_src = NULL, *filt_out = NULL, *filt_crop;
      AVCodecContext *codec = is->video_st->codec;
  
-     snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%d", sws_flags);
 +    if (!buffersink_params)
 +        return AVERROR(ENOMEM);
 +
+     snprintf(sws_flags_str, sizeof(sws_flags_str), "flags=%"PRId64, sws_flags);
      graph->scale_sws_opts = av_strdup(sws_flags_str);
  
 -    snprintf(buffersrc_args, sizeof(buffersrc_args), "%d:%d:%d:%d:%d:%d:%d",
 +    snprintf(buffersrc_args, sizeof(buffersrc_args),
 +             "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
               codec->width, codec->height, codec->pix_fmt,
               is->video_st->time_base.num, is->video_st->time_base.den,
 -             codec->sample_aspect_ratio.num, codec->sample_aspect_ratio.den);
 -
 +             codec->sample_aspect_ratio.num, FFMAX(codec->sample_aspect_ratio.den, 1));
  
      if ((ret = avfilter_graph_create_filter(&filt_src,
                                              avfilter_get_by_name("buffer"),