mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 17:40:12 +00:00
Libavcodec common: return print_decoder_error
Needed by audio libavcodec, if linking with the object, there would be needed to link also with VDPAU which doesn't look fortunate.
This commit is contained in:
@@ -158,24 +158,6 @@ const struct uv_to_av_pixfmt *get_av_to_ug_pixfmts() {
|
||||
//
|
||||
// utility functions
|
||||
//
|
||||
void print_decoder_error(const char *mod_name, int rc) {
|
||||
char buf[1024];
|
||||
switch (rc) {
|
||||
case 0:
|
||||
break;
|
||||
case EAGAIN:
|
||||
log_msg(LOG_LEVEL_VERBOSE, "%s No frame returned - needs more input data.\n", mod_name);
|
||||
break;
|
||||
case EINVAL:
|
||||
log_msg(LOG_LEVEL_ERROR, "%s Decoder in invalid state!\n", mod_name);
|
||||
break;
|
||||
default:
|
||||
av_strerror(rc, buf, 1024);
|
||||
log_msg(LOG_LEVEL_WARNING, "%s Error while decoding frame (rc == %d): %s.\n", mod_name, rc, buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void print_libav_error(int verbosity, const char *msg, int rc) {
|
||||
char errbuf[1024];
|
||||
av_strerror(rc, errbuf, sizeof(errbuf));
|
||||
|
||||
@@ -117,7 +117,25 @@ extern "C" {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void print_decoder_error(const char *mod_name, int rc);
|
||||
static void print_decoder_error(const char *mod_name, int rc) ATTRIBUTE(unused);
|
||||
static void print_decoder_error(const char *mod_name, int rc) {
|
||||
char buf[1024];
|
||||
switch (rc) {
|
||||
case 0:
|
||||
break;
|
||||
case EAGAIN:
|
||||
log_msg(LOG_LEVEL_VERBOSE, "%s No frame returned - needs more input data.\n", mod_name);
|
||||
break;
|
||||
case EINVAL:
|
||||
log_msg(LOG_LEVEL_ERROR, "%s Decoder in invalid state!\n", mod_name);
|
||||
break;
|
||||
default:
|
||||
av_strerror(rc, buf, 1024);
|
||||
log_msg(LOG_LEVEL_WARNING, "%s Error while decoding frame (rc == %d): %s.\n", mod_name, rc, buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void print_libav_error(int verbosity, const char *msg, int rc);
|
||||
bool libav_codec_has_extradata(codec_t codec);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user