summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ffmpeg.c7
-rw-r--r--ffmpeg.h1
-rw-r--r--libavcodec/internal.h1
-rw-r--r--libavcodec/utils.c6
4 files changed, 7 insertions, 8 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 9a8e65a..ff5f98b 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2357,13 +2357,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo
ist->pts = ist->next_pts;
ist->dts = ist->next_dts;
- if (avpkt.size && avpkt.size != pkt->size &&
- !(ist->dec->capabilities & AV_CODEC_CAP_SUBFRAMES)) {
- av_log(NULL, ist->showed_multi_packet_warning ? AV_LOG_VERBOSE : AV_LOG_WARNING,
- "Multiple frames in a packet from stream %d\n", pkt->stream_index);
- ist->showed_multi_packet_warning = 1;
- }
-
switch (ist->dec_ctx->codec_type) {
case AVMEDIA_TYPE_AUDIO:
ret = decode_audio (ist, &avpkt, &got_output);
diff --git a/ffmpeg.h b/ffmpeg.h
index 0d01d2b..3ba62a1 100644
--- a/ffmpeg.h
+++ b/ffmpeg.h
@@ -287,7 +287,6 @@ typedef struct InputStream {
double ts_scale;
int saw_first_ts;
- int showed_multi_packet_warning;
AVDictionary *decoder_opts;
AVRational framerate; /* framerate forced with -r */
int top_field_first;
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 000fe26..35b9630 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -173,6 +173,7 @@ typedef struct AVCodecInternal {
int buffer_pkt_valid; // encoding: packet without data can be valid
AVFrame *buffer_frame;
int draining_done;
+ int showed_multi_packet_warning;
} AVCodecInternal;
struct AVCodecDefault {
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index cf85300..ef3da65 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2461,6 +2461,12 @@ fail:
av_assert0(ret <= avpkt->size);
+ if (!avci->showed_multi_packet_warning &&
+ ret >= 0 && ret != avpkt->size && !(avctx->codec->capabilities & AV_CODEC_CAP_SUBFRAMES)) {
+ av_log(avctx, AV_LOG_WARNING, "Multiple frames in a packet.\n");
+ avci->showed_multi_packet_warning = 1;
+ }
+
return ret;
}
OpenPOWER on IntegriCloud