]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/img2enc.c
Merge commit 'acb0dea27efff4b35796015b96570b59fd517078'
[ffmpeg] / libavformat / img2enc.c
index 1297b1aaba5f8966c1a6469c122f08d0f6a422f9..d793807b33cef590e9161c80fb58e977b0557653 100644 (file)
@@ -62,6 +62,8 @@ static int write_header(AVFormatContext *s)
 
     if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
         img->muxer = "gif";
+    } else if (st->codecpar->codec_id == AV_CODEC_ID_FITS) {
+        img->muxer = "fits";
     } else if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
         const char *str = strrchr(img->path, '.');
         img->split_planes =     str
@@ -159,8 +161,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
         st->id = pkt->stream_index;
 
         fmt->pb = pb[0];
-        if ((ret = av_copy_packet(&pkt2, pkt))                            < 0 ||
-            (ret = av_dup_packet(&pkt2))                                  < 0 ||
+        if ((ret = av_packet_ref(&pkt2, pkt))                             < 0 ||
             (ret = avcodec_parameters_copy(st->codecpar, s->streams[0]->codecpar)) < 0 ||
             (ret = avformat_write_header(fmt, NULL))                      < 0 ||
             (ret = av_interleaved_write_frame(fmt, &pkt2))                < 0 ||