mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 12:10:37 +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 */
|
||||
/* framerate is already up-to-date */
|
||||
height = (dvdemux->PAL ? PAL_HEIGHT : NTSC_HEIGHT);
|
||||
height = dvdemux->decoder->height;
|
||||
wide = dv_format_wide (dvdemux->decoder);
|
||||
|
||||
/* see if anything changed */
|
||||
|
@ -1304,7 +1304,7 @@ gst_dvdemux_demux_video (GstDVDemux * dvdemux, GstBuffer * buffer,
|
|||
dvdemux->height = height;
|
||||
dvdemux->wide = wide;
|
||||
|
||||
if (dvdemux->PAL) {
|
||||
if (dvdemux->decoder->system == e_dv_system_625_50) {
|
||||
if (wide) {
|
||||
par_x = PAL_WIDE_PAR_X;
|
||||
par_y = PAL_WIDE_PAR_Y;
|
||||
|
@ -1364,7 +1364,7 @@ gst_dvdemux_is_new_media (GstDVDemux * dvdemux, GstBuffer * buffer)
|
|||
int dif;
|
||||
int n_difs;
|
||||
|
||||
n_difs = dvdemux->PAL ? 12 : 10;
|
||||
n_difs = dvdemux->decoder->num_dif_seqs;
|
||||
|
||||
for (dif = 0; dif < n_difs; dif++) {
|
||||
if (dif & 1) {
|
||||
|
@ -1500,9 +1500,8 @@ gst_dvdemux_flush (GstDVDemux * dvdemux)
|
|||
goto parse_header_error;
|
||||
|
||||
/* after parsing the header we know the length of the data */
|
||||
dvdemux->PAL = dv_system_50_fields (dvdemux->decoder);
|
||||
length = dvdemux->frame_len = (dvdemux->PAL ? PAL_BUFFER : NTSC_BUFFER);
|
||||
if (dvdemux->PAL) {
|
||||
length = dvdemux->frame_len = dvdemux->decoder->frame_size;
|
||||
if (dvdemux->decoder->system == e_dv_system_625_50) {
|
||||
dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR;
|
||||
dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR;
|
||||
} else {
|
||||
|
@ -1626,9 +1625,8 @@ gst_dvdemux_loop (GstPad * pad)
|
|||
goto parse_header_error;
|
||||
|
||||
/* after parsing the header we know the length of the data */
|
||||
dvdemux->PAL = dv_system_50_fields (dvdemux->decoder);
|
||||
dvdemux->frame_len = (dvdemux->PAL ? PAL_BUFFER : NTSC_BUFFER);
|
||||
if (dvdemux->PAL) {
|
||||
dvdemux->frame_len = dvdemux->decoder->frame_size;
|
||||
if (dvdemux->decoder->system == e_dv_system_625_50) {
|
||||
dvdemux->framerate_numerator = PAL_FRAMERATE_NUMERATOR;
|
||||
dvdemux->framerate_denominator = PAL_FRAMERATE_DENOMINATOR;
|
||||
} else {
|
||||
|
|
|
@ -57,8 +57,6 @@ struct _GstDVDemux {
|
|||
GstAdapter *adapter;
|
||||
gint frame_len;
|
||||
|
||||
/* PAL or NTSC flag */
|
||||
gboolean PAL;
|
||||
/* video params */
|
||||
gint framerate_numerator;
|
||||
gint framerate_denominator;
|
||||
|
|
Loading…
Reference in a new issue