History

avcodec: prefer decoders without CODEC_CAP_EXPERIMENTAL

Nathan Caldwell committed 14 years ago

Commit a4aa20f1 parent 620345f1 file · +9 −10Browse files

Unified · Split

libavcodec/utils.c+9−10
@@ -1490,12 +1490,13 @@ av_cold int avcodec_close(AVCodecContext *avctx) · 1489 unmodified lines
1490 return 0;1490 return 0;
1491}1491}
1492 1492
1493AVCodec *avcodec_find_encoder(enum AVCodecID id)1493static AVCodec *find_encdec(enum AVCodecID id, int encoder)
1494{1494{
1495 AVCodec *p, *experimental = NULL;1495 AVCodec *p, *experimental = NULL;
1496 p = first_avcodec;1496 p = first_avcodec;
1497 while (p) {1497 while (p) {
1498 if (av_codec_is_encoder(p) && p->id == id) {1498 if ((encoder ? av_codec_is_encoder(p) : av_codec_is_decoder(p)) &&
1499 p->id == id) {
1499 if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {1500 if (p->capabilities & CODEC_CAP_EXPERIMENTAL && !experimental) {
1500 experimental = p;1501 experimental = p;
1501 } else1502 } else
@@ -1506,6 +1507,11 @@ AVCodec *avcodec_find_encoder(enum AVCodecID id) · 4 unmodified lines
1506 return experimental;1507 return experimental;
1507}1508}
1508 1509
1510AVCodec *avcodec_find_encoder(enum AVCodecID id)
1511{
1512 return find_encdec(id, 1);
1513}
1514
1509AVCodec *avcodec_find_encoder_by_name(const char *name)1515AVCodec *avcodec_find_encoder_by_name(const char *name)
1510{1516{
1511 AVCodec *p;1517 AVCodec *p;
@@ -1522,14 +1528,7 @@ AVCodec *avcodec_find_encoder_by_name(const char *name) · 10 unmodified lines
1522 1528
1523AVCodec *avcodec_find_decoder(enum AVCodecID id)1529AVCodec *avcodec_find_decoder(enum AVCodecID id)
1524{1530{
1525 AVCodec *p;1531 return find_encdec(id, 0);
1526 p = first_avcodec;
1527 while (p) {
1528 if (av_codec_is_decoder(p) && p->id == id)
1529 return p;
1530 p = p->next;
1531 }
1532 return NULL;
1533}1532}
1534 1533
1535AVCodec *avcodec_find_decoder_by_name(const char *name)1534AVCodec *avcodec_find_decoder_by_name(const char *name)

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