History

lavf/oggenc: use meaningful error codes

Lukasz Marek committed 11 years ago

Commit 650aa361 parent 85245581 file · +5 −5Browse files

Unified · Split

libavformat/oggenc.c+5−5
@@ -348,7 +348,7 @@ static int ogg_build_speex_headers(AVCodecContext *avctx, · 347 unmodified lines
348348 uint8_t *p;
349349
350350 if (avctx->extradata_size < SPEEX_HEADER_SIZE)
351− return -1;
351+ return AVERROR_INVALIDDATA;
352352
353353 // first packet: Speex header
354354 p = av_mallocz(SPEEX_HEADER_SIZE);
@@ -377,7 +377,7 @@ static int ogg_build_opus_headers(AVCodecContext *avctx, · 22 unmodified lines
377377 uint8_t *p;
378378
379379 if (avctx->extradata_size < OPUS_HEADER_SIZE)
380− return -1;
380+ return AVERROR_INVALIDDATA;
381381
382382 /* first packet: Opus header */
383383 p = av_mallocz(avctx->extradata_size);
@@ -446,12 +446,12 @@ static int ogg_write_header(AVFormatContext *s) · 62 unmodified lines
446446 st->codec->codec_id != AV_CODEC_ID_FLAC &&
447447 st->codec->codec_id != AV_CODEC_ID_OPUS) {
448448 av_log(s, AV_LOG_ERROR, "Unsupported codec id in stream %d\n", i);
449− return -1;
449+ return AVERROR(EINVAL);
450450 }
451451
452452 if (!st->codec->extradata || !st->codec->extradata_size) {
453453 av_log(s, AV_LOG_ERROR, "No extradata present\n");
454− return -1;
454+ return AVERROR_INVALIDDATA;
455455 }
456456 oggstream = av_mallocz(sizeof(*oggstream));
457457 if (!oggstream)
@@ -511,7 +511,7 @@ static int ogg_write_header(AVFormatContext *s) · 53 unmodified lines
511511 oggstream->header, oggstream->header_len) < 0) {
512512 av_log(s, AV_LOG_ERROR, "Extradata corrupted\n");
513513 av_freep(&st->priv_data);
514− return -1;
514+ return AVERROR_INVALIDDATA;
515515 }
516516
517517 p = ogg_write_vorbiscomment(7, s->flags & AVFMT_FLAG_BITEXACT,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t