generic-pc: improve decoder info messages

This commit is contained in:
Stefan Seyfried
2013-06-01 15:41:32 +02:00
parent 619751eaf0
commit 94830cf33f
2 changed files with 7 additions and 4 deletions

View File

@@ -329,6 +329,7 @@ void cAudio::run()
int obuf_sz_max = 0; int obuf_sz_max = 0;
int o_ch, o_sr; /* output channels and sample rate */ int o_ch, o_sr; /* output channels and sample rate */
uint64_t o_layout; /* output channels layout */ uint64_t o_layout; /* output channels layout */
char tmp[64] = "unknown";
curr_pts = 0; curr_pts = 0;
av_init_packet(&avpkt); av_init_packet(&avpkt);
@@ -362,7 +363,7 @@ void cAudio::run()
c = avfc->streams[0]->codec; c = avfc->streams[0]->codec;
codec = avcodec_find_decoder(c->codec_id); codec = avcodec_find_decoder(c->codec_id);
if (!codec) { if (!codec) {
lt_info("%s: Codec not found\n", __func__); lt_info("%s: Codec for %s not found\n", __func__, avcodec_get_name(c->codec_id));
goto out; goto out;
} }
if (avcodec_open2(c, codec, NULL) < 0) { if (avcodec_open2(c, codec, NULL) < 0) {
@@ -402,8 +403,9 @@ void cAudio::run()
fprintf(stderr, " %s", ai->options[i]); fprintf(stderr, " %s", ai->options[i]);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
#endif #endif
lt_info("codec params: sample_fmt %d sample_rate %d channels %d\n", av_get_sample_fmt_string(tmp, sizeof(tmp), c->sample_fmt);
c->sample_fmt, c->sample_rate, c->channels); lt_info("decoding %s, sample_fmt %d (%s) sample_rate %d channels %d\n",
avcodec_get_name(c->codec_id), c->sample_fmt, tmp, c->sample_rate, c->channels);
swr = swr_alloc_set_opts(swr, swr = swr_alloc_set_opts(swr,
o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */ o_layout, AV_SAMPLE_FMT_S16, o_sr, /* output */
c->channel_layout, c->sample_fmt, c->sample_rate, /* input */ c->channel_layout, c->sample_fmt, c->sample_rate, /* input */

View File

@@ -445,7 +445,7 @@ void cVideo::run(void)
c = avfc->streams[0]->codec; c = avfc->streams[0]->codec;
codec = avcodec_find_decoder(c->codec_id); codec = avcodec_find_decoder(c->codec_id);
if (!codec) { if (!codec) {
lt_info("%s: Codec not found\n", __func__); lt_info("%s: Codec for %s not found\n", __func__, avcodec_get_name(c->codec_id));
goto out; goto out;
} }
if (avcodec_open2(c, codec, NULL) < 0) { if (avcodec_open2(c, codec, NULL) < 0) {
@@ -458,6 +458,7 @@ void cVideo::run(void)
lt_info("%s: Could not allocate video frame\n", __func__); lt_info("%s: Could not allocate video frame\n", __func__);
goto out2; goto out2;
} }
lt_info("decoding %s\n", avcodec_get_name(c->codec_id));
while (thread_running) { while (thread_running) {
if (av_read_frame(avfc, &avpkt) < 0) { if (av_read_frame(avfc, &avpkt) < 0) {
if (warn_r - time(NULL) > 4) { if (warn_r - time(NULL) > 4) {