mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-02 12:53:29 +00:00
avcodec/dpx: Read alternative frame rate from television header
Signed-off-by: Harry Mallon <harry.mallon@codex.online>
This commit is contained in:
parent
4bdfbd688f
commit
6623421454
@ -216,10 +216,23 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
else
|
else
|
||||||
avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
|
avctx->sample_aspect_ratio = (AVRational){ 0, 1 };
|
||||||
|
|
||||||
|
/* preferred frame rate from Motion-picture film header */
|
||||||
if (offset >= 1724 + 4) {
|
if (offset >= 1724 + 4) {
|
||||||
buf = avpkt->data + 1724;
|
buf = avpkt->data + 1724;
|
||||||
i = read32(&buf, endian);
|
i = read32(&buf, endian);
|
||||||
if(i) {
|
if(i && i != 0xFFFFFFFF) {
|
||||||
|
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 (offset >= 1940 + 4 &&
|
||||||
|
!(avctx->framerate.num && avctx->framerate.den)) {
|
||||||
|
buf = avpkt->data + 1940;
|
||||||
|
i = read32(&buf, endian);
|
||||||
|
if(i && i != 0xFFFFFFFF) {
|
||||||
AVRational q = av_d2q(av_int2float(i), 4096);
|
AVRational q = av_d2q(av_int2float(i), 4096);
|
||||||
if (q.num > 0 && q.den > 0)
|
if (q.num > 0 && q.den > 0)
|
||||||
avctx->framerate = q;
|
avctx->framerate = q;
|
||||||
|
Loading…
Reference in New Issue
Block a user