Mercurial > libavformat.hg
diff matroskadec.c @ 2273:7eb456c4ed8a libavformat
Replace all occurrences of AVERROR_NOMEM with AVERROR(ENOMEM).
author | takis |
---|---|
date | Thu, 19 Jul 2007 15:21:30 +0000 |
parents | e48ed322f893 |
children | b21c2af60bc9 |
line wrap: on
line diff
--- a/matroskadec.c Thu Jul 19 14:48:13 2007 +0000 +++ b/matroskadec.c Thu Jul 19 15:21:30 2007 +0000 @@ -485,7 +485,7 @@ * byte more, read the string and NULL-terminate it ourselves. */ if (size < 0 || !(*str = av_malloc(size + 1))) { av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation failed\n"); - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if (get_buffer(pb, (uint8_t *) *str, size) != size) { offset_t pos = url_ftell(pb); @@ -581,7 +581,7 @@ if (!(*binary = av_malloc(*size))) { av_log(matroska->ctx, AV_LOG_ERROR, "Memory allocation error\n"); - return AVERROR_NOMEM; + return AVERROR(ENOMEM); } if (get_buffer(pb, *binary, *size) != *size) { @@ -2074,7 +2074,7 @@ int sri = matroska_aac_sri(audiotrack->internal_samplerate); extradata = av_malloc(5); if (extradata == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); extradata[0] = (profile << 3) | ((sri&0x0E) >> 1); extradata[1] = ((sri&0x01) << 7) | (audiotrack->channels<<3); if (strstr(track->codec_id, "SBR")) { @@ -2095,7 +2095,7 @@ extradata_size = 30; extradata = av_mallocz(extradata_size); if (extradata == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); init_put_byte(&b, extradata, extradata_size, 1, NULL, NULL, NULL, NULL); put_buffer(&b, (uint8_t *) "TTA1", 4); @@ -2164,7 +2164,7 @@ matroska->num_streams++; st = av_new_stream(s, track->stream_index); if (st == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); av_set_pts_info(st, 64, matroska->time_scale, 1000*1000*1000); /* 64 bit pts in ns */ st->codec->codec_id = codec_id; @@ -2182,7 +2182,7 @@ } else if(track->codec_priv && track->codec_priv_size > 0){ st->codec->extradata = av_malloc(track->codec_priv_size); if(st->codec->extradata == NULL) - return AVERROR_NOMEM; + return AVERROR(ENOMEM); st->codec->extradata_size = track->codec_priv_size; memcpy(st->codec->extradata,track->codec_priv+extradata_offset, track->codec_priv_size); @@ -2451,7 +2451,7 @@ pkt = av_mallocz(sizeof(AVPacket)); /* XXX: prevent data copy... */ if (av_new_packet(pkt, slice_size-offset) < 0) { - res = AVERROR_NOMEM; + res = AVERROR(ENOMEM); n = laces-1; break; }