summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-05-30 16:52:35 +0200
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2011-06-01 13:04:53 +0200
commitac41f3b036246e64d1724d945bea01d982bd1c91 (patch)
treedbc8f2ec70fadaed88e5c6c81c2c61be7ced7ae1 /ffmpeg.c
parentca858ab77d7bb49ae99485721bbbe3a580670904 (diff)
ffmpeg: handle copy of packets for AVFMT_RAWPICTURE output formats
Store AVPicture in AVPacket as required by AVFMT_RAWPICTURE formats. Fix trac issue #251.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 220feb298d..e962f1562a 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1731,6 +1731,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
}
} else {
AVFrame avframe; //FIXME/XXX remove this
+ AVPicture pict;
AVPacket opkt;
int64_t ost_tb_start_time= av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base);
@@ -1784,6 +1785,13 @@ static int output_packet(AVInputStream *ist, int ist_index,
opkt.size = data_size;
}
+ if (os->oformat->flags & AVFMT_RAWPICTURE) {
+ /* store AVPicture in AVPacket, as expected by the output format */
+ avpicture_fill(&pict, opkt.data, ost->st->codec->pix_fmt, ost->st->codec->width, ost->st->codec->height);
+ opkt.data = (uint8_t *)&pict;
+ opkt.size = sizeof(AVPicture);
+ opkt.flags |= AV_PKT_FLAG_KEY;
+ }
write_frame(os, &opkt, ost->st->codec, ost->bitstream_filters);
ost->st->codec->frame_number++;
ost->frame_number++;