ffmpeg | branch: master | Jan Sebechlebsky <sebechlebsky...@gmail.com> | Fri 
Jul 22 17:59:29 2016 +0200| [8c997b3d3d1b60288ef9cd38cf1e709245a9ae64] | 
committer: Michael Niedermayer

avcodec/mpeg4_unpack_bframes_bsf: Copy packet props

mpeg4_unpack_bframes_bsf bitstream filters constructs
resulting packet using av_packet_from_data() function.
This function however modifies only buffer (data) and leaves
other fields untouched, so the content of other fields
of the output packet is undefined.
It is working with old BSF API, since old API filters
just data and the packet fields are copied in
av_apply_bitstream_filters from input packet.

This change fixes the behaviour for the new BSF API.

Signed-off-by: Jan Sebechlebsky <sebechlebsky...@gmail.com>
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c997b3d3d1b60288ef9cd38cf1e709245a9ae64
---

 libavcodec/mpeg4_unpack_bframes_bsf.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/mpeg4_unpack_bframes_bsf.c 
b/libavcodec/mpeg4_unpack_bframes_bsf.c
index 0615621..aee8ccb 100644
--- a/libavcodec/mpeg4_unpack_bframes_bsf.c
+++ b/libavcodec/mpeg4_unpack_bframes_bsf.c
@@ -120,6 +120,12 @@ static int mpeg4_unpack_bframes_filter(AVBSFContext *ctx, 
AVPacket *out)
 
     if (nb_vop == 1 && s->b_frame_buf) {
         /* use frame from BSFContext */
+        ret = av_packet_copy_props(out, in);
+        if (ret < 0) {
+            av_packet_free(&in);
+            return ret;
+        }
+
         av_packet_from_data(out, s->b_frame_buf, s->b_frame_buf_size);
         if (in->size <= MAX_NVOP_SIZE) {
             /* N-VOP */

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to