Re: [FFmpeg-devel] [PATCH] avcodec/dpx: Read alternative frame rate from television header

2020-08-15 Thread Michael Niedermayer
On Fri, Aug 14, 2020 at 01:30:24AM -0700, Harry Mallon wrote:
> Signed-off-by: Harry Mallon 
> ---
>  libavcodec/dpx.c | 14 +-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> index b1833ed9ef..694deb27c5 100644
> --- a/libavcodec/dpx.c
> +++ b/libavcodec/dpx.c
> @@ -216,10 +216,22 @@ static int decode_frame(AVCodecContext *avctx,
>  else
>  avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
> 
> +/* preferred frame rate from Motion-picture film header */
>  if (offset >= 1724 + 4) {
>  buf = avpkt->data + 1724;
>  i = read32(&buf, endian);
> -if(i) {
> +if(i && i != 0x) {
> +AVRational q = av_d2q(av_int2float(i), 4096);
> +if (q.num > 0 && q.den > 0)
> +avctx->framerate = q;
> +}
> +}
> +
> +/* alternative frame rate from television header */

> +if (!(avctx->framerate.num && avctx->framerate.den) && offset >=
> 1940 + 4) {
> +buf = avpkt->data + 1940;

Theres a linebreak which will break the diff (possibly from the used editor or
mail user agent)

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/dpx: Read alternative frame rate from television header

2020-08-14 Thread Harry Mallon
Signed-off-by: Harry Mallon 
---
 libavcodec/dpx.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index b1833ed9ef..694deb27c5 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -216,10 +216,22 @@ static int decode_frame(AVCodecContext *avctx,
 else
 avctx->sample_aspect_ratio = (AVRational){ 0, 1 };

+/* preferred frame rate from Motion-picture film header */
 if (offset >= 1724 + 4) {
 buf = avpkt->data + 1724;
 i = read32(&buf, endian);
-if(i) {
+if(i && i != 0x) {
+AVRational q = av_d2q(av_int2float(i), 4096);
+if (q.num > 0 && q.den > 0)
+avctx->framerate = q;
+}
+}
+
+/* alternative frame rate from television header */
+if (!(avctx->framerate.num && avctx->framerate.den) && offset >=
1940 + 4) {
+buf = avpkt->data + 1940;
+i = read32(&buf, endian);
+if(i && i != 0x) {
 AVRational q = av_d2q(av_int2float(i), 4096);
 if (q.num > 0 && q.den > 0)
 avctx->framerate = q;
-- 
2.28.0
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avcodec/dpx: Read alternative frame rate from television header

2020-08-13 Thread Harry Mallon
Signed-off-by: Harry Mallon 
---
 libavcodec/dpx.c | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index b1833ed9ef..694deb27c5 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -216,10 +216,22 @@ static int decode_frame(AVCodecContext *avctx,
 else
 avctx->sample_aspect_ratio = (AVRational){ 0, 1 };

+/* preferred frame rate from Motion-picture film header */
 if (offset >= 1724 + 4) {
 buf = avpkt->data + 1724;
 i = read32(&buf, endian);
-if(i) {
+if(i && i != 0x) {
+AVRational q = av_d2q(av_int2float(i), 4096);
+if (q.num > 0 && q.den > 0)
+avctx->framerate = q;
+}
+}
+
+/* alternative frame rate from television header */
+if (!(avctx->framerate.num && avctx->framerate.den) && offset >=
1940 + 4) {
+buf = avpkt->data + 1940;
+i = read32(&buf, endian);
+if(i && i != 0x) {
 AVRational q = av_d2q(av_int2float(i), 4096);
 if (q.num > 0 && q.den > 0)
 avctx->framerate = q;
-- 
2.28.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".