[FFmpeg-devel] [PATCH]Set interlaced flag when muxing interlaced dnxhd into mxf
Carl Eugen Hoyos
cehoyos at ag.or.at
Mon May 4 12:18:16 CEST 2015
On Monday 20 April 2015 12:26:50 am Tomas Härdin wrote:
> On Fri, 2015-04-17 at 00:31 +0200, Carl Eugen Hoyos wrote:
> > Hi!
> >
> > Completely untested.
The original patch was successfully tested:
http://ffmpeg.gusari.org/viewtopic.php?f=11&t=2065
> No idea really. Can't this flag be taken automagically
> from the codec somehow?
New patch attached.
Please review, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index b648899..ef918b0 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1102,6 +1102,14 @@ int avpriv_dnxhd_get_frame_size(int cid)
return ff_dnxhd_cid_table[i].frame_size;
}
+int avpriv_dnxhd_get_interlaced(int cid)
+{
+ int i = ff_dnxhd_get_cid_table(cid);
+ if (i < 0)
+ return i;
+ return ff_dnxhd_cid_table[i].interlaced;
+}
+
int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
{
int i, j;
diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h
index d5629e2..8cc27e8 100644
--- a/libavcodec/dnxhddata.h
+++ b/libavcodec/dnxhddata.h
@@ -53,5 +53,6 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth);
void ff_dnxhd_print_profiles(AVCodecContext *avctx, int loglevel);
int avpriv_dnxhd_get_frame_size(int cid);
+int avpriv_dnxhd_get_interlaced(int cid);
#endif /* AVCODEC_DNXHDDATA_H */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 69f9759..41c4145 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,8 +29,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR 35
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR 36
+#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index efa1e04..5966792 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1640,6 +1640,8 @@ AVPacket *pkt)
if ((frame_size = avpriv_dnxhd_get_frame_size(cid)) < 0)
return -1;
+ if ((sc->interlaced = avpriv_dnxhd_get_interlaced(cid)) < 0)
+ return AVERROR_INVALIDDATA;
switch (cid) {
case 1235:
diff --git a/libavformat/version.h b/libavformat/version.h
index 381c071..8733dc3 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
#define LIBAVFORMAT_VERSION_MAJOR 56
#define LIBAVFORMAT_VERSION_MINOR 31
-#define LIBAVFORMAT_VERSION_MICRO 100
+#define LIBAVFORMAT_VERSION_MICRO 101
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
More information about the ffmpeg-devel
mailing list