Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 640628
Collapse All | Expand All

(-)a/src/3rdparty/chromium/media/ffmpeg/ffmpeg_common.cc (-6 / +6 lines)
Lines 30-39 Link Here
30
30
31
}  // namespace
31
}  // namespace
32
32
33
// Why FF_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
33
// Why AV_INPUT_BUFFER_PADDING_SIZE? FFmpeg assumes all input buffers are
34
// padded. Check here to ensure FFmpeg only receives data padded to its
34
// padded. Check here to ensure FFmpeg only receives data padded to its
35
// specifications.
35
// specifications.
36
static_assert(DecoderBuffer::kPaddingSize >= FF_INPUT_BUFFER_PADDING_SIZE,
36
static_assert(DecoderBuffer::kPaddingSize >= AV_INPUT_BUFFER_PADDING_SIZE,
37
              "DecoderBuffer padding size does not fit ffmpeg requirement");
37
              "DecoderBuffer padding size does not fit ffmpeg requirement");
38
38
39
// Alignment requirement by FFmpeg for input and output buffers. This need to
39
// Alignment requirement by FFmpeg for input and output buffers. This need to
Lines 429-439 Link Here
429
  } else {
429
  } else {
430
    codec_context->extradata_size = config.extra_data().size();
430
    codec_context->extradata_size = config.extra_data().size();
431
    codec_context->extradata = reinterpret_cast<uint8_t*>(
431
    codec_context->extradata = reinterpret_cast<uint8_t*>(
432
        av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE));
432
        av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE));
433
    memcpy(codec_context->extradata, &config.extra_data()[0],
433
    memcpy(codec_context->extradata, &config.extra_data()[0],
434
           config.extra_data().size());
434
           config.extra_data().size());
435
    memset(codec_context->extradata + config.extra_data().size(), '\0',
435
    memset(codec_context->extradata + config.extra_data().size(), '\0',
436
           FF_INPUT_BUFFER_PADDING_SIZE);
436
           AV_INPUT_BUFFER_PADDING_SIZE);
437
  }
437
  }
438
}
438
}
439
439
Lines 561-571 Link Here
561
  } else {
561
  } else {
562
    codec_context->extradata_size = config.extra_data().size();
562
    codec_context->extradata_size = config.extra_data().size();
563
    codec_context->extradata = reinterpret_cast<uint8_t*>(
563
    codec_context->extradata = reinterpret_cast<uint8_t*>(
564
        av_malloc(config.extra_data().size() + FF_INPUT_BUFFER_PADDING_SIZE));
564
        av_malloc(config.extra_data().size() + AV_INPUT_BUFFER_PADDING_SIZE));
565
    memcpy(codec_context->extradata, &config.extra_data()[0],
565
    memcpy(codec_context->extradata, &config.extra_data()[0],
566
           config.extra_data().size());
566
           config.extra_data().size());
567
    memset(codec_context->extradata + config.extra_data().size(), '\0',
567
    memset(codec_context->extradata + config.extra_data().size(), '\0',
568
           FF_INPUT_BUFFER_PADDING_SIZE);
568
           AV_INPUT_BUFFER_PADDING_SIZE);
569
  }
569
  }
570
}
570
}
571
571
(-)a/src/3rdparty/chromium/media/filters/ffmpeg_audio_decoder.cc (-1 / +1 lines)
Lines 53-59 Link Here
53
// AVCodecContext.opaque to get the object reference in order to call
53
// AVCodecContext.opaque to get the object reference in order to call
54
// GetAudioBuffer() to do the actual allocation.
54
// GetAudioBuffer() to do the actual allocation.
55
static int GetAudioBuffer(struct AVCodecContext* s, AVFrame* frame, int flags) {
55
static int GetAudioBuffer(struct AVCodecContext* s, AVFrame* frame, int flags) {
56
  DCHECK(s->codec->capabilities & CODEC_CAP_DR1);
56
  DCHECK(s->codec->capabilities & AV_CODEC_CAP_DR1);
57
  DCHECK_EQ(s->codec_type, AVMEDIA_TYPE_AUDIO);
57
  DCHECK_EQ(s->codec_type, AVMEDIA_TYPE_AUDIO);
58
58
59
  // Since this routine is called by FFmpeg when a buffer is required for audio
59
  // Since this routine is called by FFmpeg when a buffer is required for audio
(-)a/src/3rdparty/chromium/media/filters/ffmpeg_video_decoder.cc (-2 / +2 lines)
Lines 415-426 Link Here
415
  codec_context_->thread_type =
415
  codec_context_->thread_type =
416
      FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME);
416
      FF_THREAD_SLICE | (low_delay ? 0 : FF_THREAD_FRAME);
417
  codec_context_->opaque = this;
417
  codec_context_->opaque = this;
418
  codec_context_->flags |= CODEC_FLAG_EMU_EDGE;
418
  /* CODEC_FLAG_EMU_EDGE is deprecated codec_context_->flags |= CODEC_FLAG_EMU_EDGE; */
419
  codec_context_->get_buffer2 = GetVideoBufferImpl;
419
  codec_context_->get_buffer2 = GetVideoBufferImpl;
420
  codec_context_->refcounted_frames = 1;
420
  codec_context_->refcounted_frames = 1;
421
421
422
  if (decode_nalus_)
422
  if (decode_nalus_)
423
    codec_context_->flags2 |= CODEC_FLAG2_CHUNKS;
423
    codec_context_->flags2 |= AV_CODEC_FLAG2_CHUNKS;
424
424
425
  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
425
  AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
426
  if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
426
  if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {

Return to bug 640628