mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 22:48:49 +00:00
dvdemux: Use values from decoder structure directly
Don't store the same values in the GstDvDemux. This fixes a bug where dvdemux would detect a stream as PAL instead of NTSC, and silently parse it wrong.
This commit is contained in:
parent
29173242bb
commit
903c79e767
2 changed files with 7 additions and 11 deletions
|
@ -1293,7 +1293,7 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer,
|
||||||
|
|
||||||
/* get params */
|
/* get params */
|
||||||
/* framerate is already up-to-date */
|
/* framerate is already up-to-date */
|
||||||
height = (dvdemux->PAL ? PAL_HEIGHT : NTSC_HEIGHT);
|
height = dvdemux->decoder->height;
|
||||||
wide = dv_format_wide (dvdemux->decoder);
|
wide = dv_format_wide (dvdemux->decoder);
|
||||||
|
|
||||||
/* see if anything changed */
|
/* see if anything changed */
|
||||||
|
@ -1304,7 +1304,7 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer,
|
||||||
dvdemux->height = height;
|
dvdemux->height = height;
|
||||||
dvdemux->wide = wide;
|
dvdemux->wide = wide;
|
||||||
|
|
||||||
if (dvdemux->PAL) {
|
if (dvdemux->decoder->system == e_dv_system_625_50) {
|
||||||
if (wide) {
|
if (wide) {
|
||||||
par_x = PAL_WIDE_PAR_X;
|
par_x = PAL_WIDE_PAR_X;
|
||||||
par_y = PAL_WIDE_PAR_Y;
|
par_y = PAL_WIDE_PAR_Y;
|
||||||
|
@ -1364,7 +1364,7 @@ gst_dvdemux_is_new_media (GstDVDemux * dvdemux, GstBuffer * buffer)
|
||||||
int dif;
|
int dif;
|
||||||
int n_difs;
|
int n_difs;
|
||||||
|
|
||||||
n_difs = dvdemux->PAL ? 12 : 10;
|
n_difs = dvdemux->decoder->num_dif_seqs;
|
||||||
|
|
||||||
for (dif = 0; dif < n_difs; dif++) {
|
for (dif = 0; dif < n_difs; dif++) {
|
||||||
if (dif & 1) {
|
if (dif & 1) {
|
||||||
|
@ -1500,9 +1500,8 @@ gst_dvdemux_flush (GstDVDemux * dvdemux)
|
||||||
goto parse_header_error;
|
goto parse_header_error;
|
||||||
|
|
||||||
/* after parsing the header we know the length of the data */
|
/* after parsing the header we know the length of the data */
|
||||||
dvdemux->PAL = dv_system_50_fields (dvdemux->decoder);
|
length = dvdemux->frame_len = dvdemux->decoder->frame_size;
|
||||||
length = dvdemux->frame_len = (dvdemux->PAL ? PAL_BUFFER : NTSC_BUFFER);
|
if (dvdemux->decoder->system == e_dv_system_625_50) {
|
||||||
if (dvdemux->PAL) {
|
|
||||||
dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR;
|
dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR;
|
||||||
dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR;
|
dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1626,9 +1625,8 @@ gst_dvdemux_loop (GstPad * pad)
|
||||||
goto parse_header_error;
|
goto parse_header_error;
|
||||||
|
|
||||||
/* after parsing the header we know the length of the data */
|
/* after parsing the header we know the length of the data */
|
||||||
dvdemux->PAL = dv_system_50_fields (dvdemux->decoder);
|
dvdemux->frame_len = dvdemux->decoder->frame_size;
|
||||||
dvdemux->frame_len = (dvdemux->PAL ? PAL_BUFFER : NTSC_BUFFER);
|
if (dvdemux->decoder->system == e_dv_system_625_50) {
|
||||||
if (dvdemux->PAL) {
|
|
||||||
dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR;
|
dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR;
|
||||||
dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR;
|
dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -57,8 +57,6 @@ struct _GstDVDemux {
|
||||||
GstAdapter *adapter;
|
GstAdapter *adapter;
|
||||||
gint frame_len;
|
gint frame_len;
|
||||||
|
|
||||||
/* PAL or NTSC flag */
|
|
||||||
gboolean PAL;
|
|
||||||
/* video params */
|
/* video params */
|
||||||
gint framerate_numerator;
|
gint framerate_numerator;
|
||||||
gint framerate_denominator;
|
gint framerate_denominator;
|
||||||
|
|
Loading…
Reference in a new issue