Skip to content

Commit 9dc44b4

Browse files
committed
fftools/ffplay.c: Also print demuxer-level metadata updates.
1 parent ba0f808 commit 9dc44b4

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

fftools/ffplay.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,7 @@ static int read_thread(void *arg)
30073007
// initial metadata as update.
30083008
st->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
30093009
}
3010+
ic->event_flags &= ~AVFMT_EVENT_FLAG_METADATA_UPDATED;
30103011
for (i = 0; i < AVMEDIA_TYPE_NB; i++) {
30113012
if (wanted_stream_spec[i] && st_index[i] == -1) {
30123013
av_log(NULL, AV_LOG_ERROR, "Stream specifier %s does not match any %s stream\n", wanted_stream_spec[i], av_get_media_type_string(i));
@@ -3175,16 +3176,24 @@ static int read_thread(void *arg)
31753176
is->eof = 0;
31763177
}
31773178

3178-
if (show_status && ic->streams[pkt->stream_index]->event_flags &
3179-
AVSTREAM_EVENT_FLAG_METADATA_UPDATED) {
3180-
fprintf(stderr, "\x1b[2K\r");
3181-
snprintf(metadata_description,
3182-
sizeof(metadata_description),
3183-
"\r New metadata for stream %d",
3184-
pkt->stream_index);
3185-
dump_dictionary(NULL, ic->streams[pkt->stream_index]->metadata,
3186-
metadata_description, " ", AV_LOG_INFO);
3179+
if (show_status) {
3180+
if (ic->event_flags & AVFMT_EVENT_FLAG_METADATA_UPDATED) {
3181+
fprintf(stderr, "\x1b[2K\r");
3182+
dump_dictionary(NULL, ic->metadata,
3183+
"\r New metadata", " ", AV_LOG_INFO);
3184+
}
3185+
if (ic->streams[pkt->stream_index]->event_flags &
3186+
AVSTREAM_EVENT_FLAG_METADATA_UPDATED) {
3187+
fprintf(stderr, "\x1b[2K\r");
3188+
snprintf(metadata_description,
3189+
sizeof(metadata_description),
3190+
"\r New metadata for stream %d",
3191+
pkt->stream_index);
3192+
dump_dictionary(NULL, ic->streams[pkt->stream_index]->metadata,
3193+
metadata_description, " ", AV_LOG_INFO);
3194+
}
31873195
}
3196+
ic->event_flags &= ~AVFMT_EVENT_FLAG_METADATA_UPDATED;
31883197
ic->streams[pkt->stream_index]->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
31893198

31903199
/* check if packet is in play range specified by user, then queue, otherwise discard */

0 commit comments

Comments
 (0)