~ubuntu-branches/ubuntu/vivid/mpv/vivid

« back to all changes in this revision

Viewing changes to video/decode/vd_lavc.c

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2014-12-22 19:08:25 UTC
  • mfrom: (28.1.3 vivid-proposed)
  • Revision ID: package-import@ubuntu.com-20141222190825-bdtz8aiwvv65wpmi
Tags: 0.7.2-1ubuntu1
debian/rules: Disable altivec on ppc64el again, as it FTBFS with it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
    ctx->hwdec_fmt = 0;
354
354
    ctx->avctx = avcodec_alloc_context3(lavc_codec);
355
355
    AVCodecContext *avctx = ctx->avctx;
 
356
    if (!ctx->avctx)
 
357
        goto error;
356
358
    avctx->bit_rate = 0;
357
359
    avctx->opaque = vd;
358
360
    avctx->codec_type = AVMEDIA_TYPE_VIDEO;
360
362
 
361
363
    avctx->refcounted_frames = 1;
362
364
    ctx->pic = av_frame_alloc();
 
365
    if (!ctx->pic)
 
366
        goto error;
363
367
 
364
368
    if (ctx->hwdec) {
365
369
        avctx->thread_count    = 1;
366
370
        avctx->get_format      = get_format_hwdec;
367
371
        avctx->get_buffer2     = get_buffer2_hwdec;
368
 
        if (ctx->hwdec->init(ctx) < 0) {
369
 
            uninit_avctx(vd);
370
 
            return;
371
 
        }
 
372
        if (ctx->hwdec->init(ctx) < 0)
 
373
            goto error;
372
374
    } else {
373
375
        mp_set_avcodec_threads(avctx, lavc_param->threads);
374
376
    }
418
420
        mp_copy_lav_codec_headers(avctx, sh->lav_headers);
419
421
 
420
422
    /* open it */
421
 
    if (avcodec_open2(avctx, lavc_codec, NULL) < 0) {
422
 
        MP_ERR(vd, "Could not open codec.\n");
423
 
        uninit_avctx(vd);
424
 
        return;
425
 
    }
 
423
    if (avcodec_open2(avctx, lavc_codec, NULL) < 0)
 
424
        goto error;
 
425
 
 
426
    return;
 
427
 
 
428
error:
 
429
    MP_ERR(vd, "Could not open codec.\n");
 
430
    uninit_avctx(vd);
426
431
}
427
432
 
428
433
static void uninit_avctx(struct dec_video *vd)