summaryrefslogtreecommitdiffstats
path: root/video/decode/dec_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/decode/dec_video.c')
-rw-r--r--video/decode/dec_video.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index 5231fad240..bd20dbe312 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -13,6 +13,10 @@
*
* You should have received a copy of the GNU General Public License along
* with mpv. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Almost LGPL.
+ *
+ * Parts under HAVE_GPL are licensed under GNU General Public License forever.
*/
#include <stdio.h>
@@ -197,12 +201,16 @@ static void fix_image_params(struct dec_video *d_video,
// While mp_image_params normally always have to have d_w/d_h set, the
// decoder signals unknown bitstream aspect ratio with both set to 0.
float dec_aspect = p.p_w > 0 && p.p_h > 0 ? p.p_w / (float)p.p_h : 0;
+
+#if HAVE_GPL
if (d_video->initial_decoder_aspect == 0)
d_video->initial_decoder_aspect = dec_aspect;
+#endif
bool use_container = true;
switch (opts->aspect_method) {
case 0:
+#if HAVE_GPL
// We normally prefer the container aspect, unless the decoder aspect
// changes at least once.
if (dec_aspect > 0 && d_video->initial_decoder_aspect != dec_aspect) {
@@ -212,8 +220,14 @@ static void fix_image_params(struct dec_video *d_video,
use_container = false;
}
break;
+#else
+ /* fall through, behave as "bitstream" */
+#endif
case 1:
- use_container = false;
+ if (dec_aspect) {
+ MP_VERBOSE(d_video, "Using bitstream aspect ratio.\n");
+ use_container = false;
+ }
break;
}
@@ -300,12 +314,14 @@ static bool receive_frame(struct dec_video *d_video, struct mp_image **out_image
if (!mpi)
return progress;
+#if HAVE_GPL
if (opts->field_dominance == 0) {
mpi->fields |= MP_IMGFIELD_TOP_FIRST | MP_IMGFIELD_INTERLACED;
} else if (opts->field_dominance == 1) {
mpi->fields &= ~MP_IMGFIELD_TOP_FIRST;
mpi->fields |= MP_IMGFIELD_INTERLACED;
}
+#endif
// Note: the PTS is reordered, but the DTS is not. Both should be monotonic.
double pts = mpi->pts;