# HG changeset patch # User nicodvb # Date 1162032732 0 # Node ID 0398b9cbd66d0c9eac73732d8163fe3292b0fd18 # Parent 054516eecb9b8b615a63de905840332157247fb1 unconditionally assign the language code when available; more simplifications diff -r 054516eecb9b -r 0398b9cbd66d libmpdemux/demux_ts.c --- a/libmpdemux/demux_ts.c Sat Oct 28 10:44:45 2006 +0000 +++ b/libmpdemux/demux_ts.c Sat Oct 28 10:52:12 2006 +0000 @@ -2864,6 +2864,8 @@ if(is_start) { + uint8_t *lang = NULL; + mp_msg(MSGT_DEMUX, MSGL_DBG2, "IS_START\n"); p = &packet[base]; @@ -2878,27 +2880,26 @@ } es->pid = tss->pid; tss->is_synced |= es->is_synced || rap_flag; + tss->payload_size = es->payload_size; + + if(is_audio) + lang = pid_lang_from_pmt(priv, es->pid); + if(lang != NULL) + { + memcpy(es->lang, lang, 3); + es->lang[3] = 0; + } + else + es->lang[0] = 0; if(probe) { - uint8_t *lang = NULL; - if(es->type == UNKNOWN) return 0; - tss->payload_size = es->payload_size; tss->type = es->type; tss->subtype = es->subtype; - if(is_audio) - lang = pid_lang_from_pmt(priv, es->pid); - if(lang != NULL) - { - memcpy(es->lang, lang, 3); - es->lang[3] = 0; - } - else - es->lang[0] = 0; return 1; } else @@ -2911,8 +2912,6 @@ mp_msg(MSGT_DEMUX, MSGL_DBG2, "ts_parse, NEW pid=%d, PSIZE: %u, type=%X, start=%p, len=%d\n", es->pid, es->payload_size, es->type, es->start, es->size); - tss->payload_size = es->payload_size; - demuxer->filepos = stream_tell(demuxer->stream) - es->size; if(*dp_offset + es->size > *buffer_size)